I wanted to sort the column having checkbox formatter
I am using checkbox formatter with formatoptions:{disabled :false}
Suppose my grid contain 6 row with three row containing checkbox as checked and other as not checked
If user check fourth checkbox and then sort thean all four rows out of six should be at the start or end of grid
currently if user click on sort then only3 rows with checkbox as checked are displayed
I am using unformat option but the unformat function is not getting called while sorting
I am using jqgrid 7.2 version
Below is the code
function myunformatCurrency (cellvalue, options, cellobject )
{
alert(cellvalue);
return cellvalue;
}
jQuery(document).ready(function(){
jQuery("#list").jqGrid({
datatype: "local",
height: 250,
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes', 'closed'],
colModel:[
{name:'id',index:'id', width:60, sorttype:"int"},
{name:'invdate',index:'invdate', width:90, sorttype:"date"},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right",sorttype:"float"},
{name:'tax',index:'tax', width:80, align:"right",sorttype:"float"},
{name:'total',index:'total', width:80,align:"right",sorttype:"float"},
{name:'note',index:'note', width:150, sortable:false},
{name:'closed',index:'closed',width:55,align:'center', editable :true, formatter:'checkbox',formatoptions:{disabled :false}, unformat:myunformatCurrency,sortable: true,sorttype:"number" }
],
caption: "Manipulating Array Data"
});
var colNames = ["id", "invdate", "name", "note", "amount", "tax", "total", "closed"];
var newData = [
[10, "2007-09-01", "test4","new data", "600.00", "1.00", "601.00", 0],
[11, "2007-09-02", "test5","new data11", "602.00", "1.00", "603.00", 1],
[12, "2007-09-02", "test5","new data11", "602.00", "1.00", "603.00", 0],
[13, "2007-09-02", "test5","new data11", "602.00", "1.00", "603.00", 1],
[14, "2007-09-02", "test5","new data11", "602.00", "1.00", "603.00",0],
[15, "2007-09-02", "test5","new data11", "602.00", "1.00", "603.00", 1]
];
for(r = 0; r < newData.length; r++)
{
for(c = 0; c <= colNames.length; c++)
{
oper = c == 0 ? 'addRowData' : 'setRowData';
jQuery("#list").jqGrid(oper,r ,eval("({" + colNames[c]+":"" + newData[r][c] + ""})"));
}
}
});
Please help
Thanks,
Viral Gala
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top