EasyUI Forum
May 16, 2024, 04:25:50 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: Accessing Checkbox column state in a datagrid  (Read 7754 times)
thecyberzone
Full Member
***
Posts: 176



View Profile Email
« on: February 02, 2015, 02:37:40 AM »

I have defined a column in a editable checkbox as follows:

{field:'final',checkbox:true},

Now to set the initial checkbox value I have used a loop as follows:

var rows = $(this).datagrid('getRows');
for(var i=0; i<rows.length; i++){
    if(rows['final'] == 'Y') {
   $(this).datagrid('checkRow',i);
    }
}

Now whenever I want to acces the checkbox value of a particular row by using row.final it always returns the initial value, not the changed value depending on checbox state checked/unchecked.

What should I use if I want to access that checkbox value/state ?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: February 02, 2015, 04:05:12 AM »

Please try this:
Code:
$('#dg').datagrid({
    onCheck: function(index,row){
        row.final = true;
    },
    onUncheck: function(index,row){
        row.final = false;
    }
})
Logged
thecyberzone
Full Member
***
Posts: 176



View Profile Email
« Reply #2 on: February 02, 2015, 07:00:12 AM »

Thanks for your reply, I have already done in the same way by assuming row.final value as 'Y' in onSelect event and row.final value as 'N' in onUnselect event.
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!