EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: mzeddd on October 24, 2011, 09:24:09 AM



Title: What datagrid('getData') returns?
Post by: mzeddd on October 24, 2011, 09:24:09 AM
Hi,

Simple question. See subject.

In case of 'getSelections' it is clear that it will be an array. This also could be checked by colling any array function

Like this:
Code:
var ar = $('#test').datagrid('getSelections');
alert(ar.length);

But the same code with 'getData' shows 'Undefined' instead of number.

So. What do I get from datagrid('getData') and how to work with it?

Thanks.


Title: Re: What datagrid('getData') returns?
Post by: dandies on December 26, 2012, 07:15:23 PM
The code below will explain your question ..

Code:
var myData = $('#my_datagrid_id').datagrid('getData');
alert('myData : ' + JSON.stringify(myData));