2014-06-19 43 views
0

我在一排像创建复选框取消选中的jqGrid,复选框检查或jqGrid的

{ 
    name: 'Confirm', index: 'Confirm', width: 100, sortable: false, 
    formatter: function (rownum, cellvalue, options, rowObject) { 
       return "<input type='checkbox' id='check' />"; 
       } 
     }, 

我像电网,enter image description here

我需要检查或基于最后一列值取消。

如果值是确认表示我需要选中复选框。

如果最后一列的值是Notconfirmed意味着我需要取消选中该复选框

注:我加载网格值从JSON

得到
+0

可以共享渲染HTML? –

+0

@MilindAnantwar我在JqGrid中创建了文本框。它显示在问题中 –

回答

2

试试这个:

$('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); 
});