EasyUI Forum

General Category => Bug Report => Topic started by: awargan on January 11, 2014, 04:30:29 AM



Title: Bug for datagrid and combobox
Post by: awargan on January 11, 2014, 04:30:29 AM
Hello,
Everyone

I found a bug for datagrid and combobox.
When I load datagrid data or combobox options from remote server, if the server returns null, an error occurred like the following.
Uncaught TypeError: Cannot read property 'length' of null     jquery.easyui.min.js:9252

Best,
Thanks!


Title: Re: Bug for datagrid and combobox
Post by: stworthy on January 11, 2014, 05:58:57 AM
You need to return the correct json data from server. Please use 'loadFilter' function to correct your returned data.
Code:
$('#dg').datagrid({
  loadFilter:function(data){
    if (!data){
      return {"total":0,"rows":[]};
    } else {
      //return other data
    }
  }
});