EasyUI Forum

General Category => Bug Report => Topic started by: phunksta on December 13, 2017, 10:45:49 AM



Title: datagrid-scrollview problem at 1.5.3
Post by: phunksta on December 13, 2017, 10:45:49 AM
Hi,

I recently attempted to upgrade my app to easyui 1.5.3, including the scrollview and edatagrid plugins.

Scrollview in particular is causing a problem, as it seems to be trying to obtain data from its parent combogrid before any has been loaded.

The error and stack trace received is as follows, with the first funciton from my app being openVrd:

Code:
17:11:49.852 jquery.easyui.min.js?v=1.5.3:12 Uncaught TypeError: Cannot read property 'length' of undefined
    at Object.indexOfArray (jquery.easyui.min.js?v=1.5.3:12)
    at Object.getRowIndex (datagrid-scrollview.js:673)
    at jQuery.fn.init.$.fn.datagrid (jquery.easyui.min.js?v=1.5.3:10816)
    at jquery.easyui.min.js?v=1.5.3:14735
    at Function.map (jquery-2.2.4.js:452)
    at _afb (jquery.easyui.min.js?v=1.5.3:14734)
    at HTMLInputElement.<anonymous> (jquery.easyui.min.js?v=1.5.3:14886)
    at Function.each (jquery-2.2.4.js:365)
    at jQuery.fn.init.each (jquery-2.2.4.js:137)
    at setValues (jquery.easyui.min.js?v=1.5.3:14874)
indexOfArray @ jquery.easyui.min.js?v=1.5.3:12
getRowIndex @ datagrid-scrollview.js:673
$.fn.datagrid @ jquery.easyui.min.js?v=1.5.3:10816
(anonymous) @ jquery.easyui.min.js?v=1.5.3:14735
map @ jquery-2.2.4.js:452
_afb @ jquery.easyui.min.js?v=1.5.3:14734
(anonymous) @ jquery.easyui.min.js?v=1.5.3:14886
each @ jquery-2.2.4.js:365
each @ jquery-2.2.4.js:137
setValues @ jquery.easyui.min.js?v=1.5.3:14874
$.fn.combogrid @ jquery.easyui.min.js?v=1.5.3:14847
(anonymous) @ jquery.easyui.min.js?v=1.5.3:14890
each @ jquery-2.2.4.js:365
each @ jquery-2.2.4.js:137
setValue @ jquery.easyui.min.js?v=1.5.3:14889
$.fn.combogrid @ jquery.easyui.min.js?v=1.5.3:14847
_59f @ jquery.easyui.min.js?v=1.5.3:7950
_59d @ jquery.easyui.min.js?v=1.5.3:7900
success @ jquery.easyui.min.js?v=1.5.3:7888
fire @ jquery-2.2.4.js:3187
fireWith @ jquery-2.2.4.js:3317
done @ jquery-2.2.4.js:8757
(anonymous) @ jquery-2.2.4.js:9123
XMLHttpRequest.send (async)
send @ jquery-2.2.4.js:9175
ajax @ jquery-2.2.4.js:8656
load @ jquery.easyui.min.js?v=1.5.3:7887
(anonymous) @ jquery.easyui.min.js?v=1.5.3:8088
each @ jquery-2.2.4.js:365
each @ jquery-2.2.4.js:137
load @ jquery.easyui.min.js?v=1.5.3:8087
$.fn.form @ jquery.easyui.min.js?v=1.5.3:8073
openVrd @ nav.js:1702
openVrdSpecific @ nav.js:1514
onClickRow @ nav.js:2142
_6c4 @ jquery.easyui.min.js?v=1.5.3:9702
dispatch @ jquery-2.2.4.js:4737
elemData.handle @ jquery-2.2.4.js:4549


jquery is at V2.2.4 and client browser is Chrome 63.


Title: Re: datagrid-scrollview problem at 1.5.3
Post by: jarry on December 14, 2017, 07:20:11 AM
Please look at this example http://code.reloado.com/ofixat/edit#preview. It works fine.


Title: Re: datagrid-scrollview problem at 1.5.3
Post by: keja on August 19, 2022, 12:36:28 AM
We are facing the same problem. However, the http://code.reloado.com/ofixat/edit#preview is not working.

Can you please post the code here


Title: Re: datagrid-scrollview problem at 1.5.3
Post by: jarry on August 21, 2022, 04:52:44 PM
This is the editable datagrid example with virtual scrollview.
Code:
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>jQuery EasyUI Demo</title>
  <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/default/easyui.css">
  <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/icon.css">
  <script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.min.js"></script>
  <script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
  <script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.edatagrid.js"></script>
  <script type="text/javascript" src="https://www.jeasyui.com/easyui/datagrid-scrollview.js"></script>
  <script type="text/javascript">
    $(function(){
      var rows = [];
      for(var i=1; i<=8000; i++){
        var amount = Math.floor(Math.random()*1000);
        var price = Math.floor(Math.random()*1000);
        rows.push({
          inv: 'Inv No '+i,
          date: $.fn.datebox.defaults.formatter(new Date()),
          name: 'Name '+i,
          amount: amount,
          price: price,
          cost: amount*price,
          note: 'Note '+i
        });
      }

      $('#dg').edatagrid({
        columns: [[
          {field:'inv',title:'Inv No',width:100,editor:'textbox'},
          {field:'date',title:'Date',width:100,editor:'datebox'},
          {field:'name',title:'Name',width:100,editor:'textbox'},
          {field:'amount',title:'Amount',width:100,editor:{type:'numberbox',options:{precision:0}}},
          {field:'price',title:'Price',width:100,editor:'numberbox'},
          {field:'note',title:'Note',width:100,editor:'textbox'}
        ]],
        data: rows,
        view: scrollview,
        fitColumns: true
      });
    });
  </script>
</head>
<body>
  <table id="dg" style="width:800px;height:400px"
      title="Editable DataGrid"
      singleSelect="true"></table>
</body>
</html>