EasyUI Forum
May 18, 2024, 01:17:15 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Bug for datagrid and combobox  (Read 10137 times)
awargan
Newbie
*
Posts: 2


View Profile Email
« 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!
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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
    }
  }
});
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!