EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: aswzen on February 03, 2016, 04:26:07 AM



Title: How to get checkbox state in a datagrid row [SOLVED]
Post by: aswzen on February 03, 2016, 04:26:07 AM
Yes, How to get checkbox state in a datagrid row by an index?

for example i want to know what is the checkbox state in row index 2?
how to do that?

thank you in advance


Title: Re: How to get checkbox state in a datagrid row
Post by: jarry on February 03, 2016, 08:23:01 AM
Get the special row and detect if it is in the checked rows.
Code:
var index = 2;
var dg = $('#dg');
var checked = dg.datagrid('getChecked');
var row = dg.datagrid('getRows')[index];
if ($.inArray(row,checked) >= 0){
  console.log('The row ' + index + ' is checked');
}


Title: Re: How to get checkbox state in a datagrid row
Post by: aswzen on February 03, 2016, 08:34:26 PM
thank you its work..

but please consider to add that method in datagrid :)
maybe like
$('#dg').datagrid('isChecked',1); // will return true or false


regards
git