Reputation: 883
I create the jqgrid with checkbox in a row like,
{
name: 'Confirm', index: 'Confirm', width: 100, sortable: false,
formatter: function (rownum, cellvalue, options, rowObject) {
return "<input type='checkbox' id='check' />";
}
},
my grid like,
I need to check or uncheck based on the last column value.
If the Value is Confirm means i need to check the checkbox.
If the last column value is Notconfirmed means i need to uncheck the checkbox
Note:I load the grid value get from JSON
Upvotes: 0
Views: 2813
Reputation: 82241
Try this:
$('tr td:last-child').each(function(){
if($(this).text()=="Confirmed")
$(this).prev().find('input').prop('checked', true);
else
$(this).prev().find('input').prop('checked', false);
});
Upvotes: 2