EasyUI Forum
September 14, 2025, 03:35:27 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Datagrid : json data containing "records" instead of "rows"  (Read 10752 times)
getk
Newbie
*
Posts: 23


View Profile
« on: May 17, 2013, 05:21:39 AM »

Hi
We have a webservices which provides json data dynamically.
Unfortunately, the format is  
Code:
"total":3,"records": [
      {
        "employeeid": "1",
        "employee_name": "ABC"
      }
     ]

Essentially its "records" instead of "rows"  in the data meta-data. We are not able to change the data coming to us.
Can we parse the data to change "records" to "rows"  OR is there any-way to populate the data into a grid?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: May 18, 2013, 12:21:27 AM »

Try the 'loadFilter' to change data to what format the datagrid requires.
Code:
$('#dg').datagrid({
loadFilter: function(data){
return {
total: data.total,
rows: data.records
}
}
});
Logged
getk
Newbie
*
Posts: 23


View Profile
« Reply #2 on: May 20, 2013, 07:59:01 AM »

thanks mate
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!