问题
I have a jqGrid with a textbox formatter column. When I perform search operation after entering something in the textbox, the textbox gets cleared. I want to retain the values in the textbox even after the search. Here's my code:
colModel : [
{name:'val',index:'val', width:40, align:'center',searchoptions: { sopt: ['eq'] } },
{name:'id',index:'id', width:50,sortable:false,align:'center',edittype: "text",search:false,formatter:ctrlformat}
]
function ctrlformat (cellvalue, options, rowObject ){
return '<input type="text" id='+cellvalue+' name="valId" />';
$("#list").jqGrid('filterToolbar', {stringResult: true, searchOnEnter:true});
}

来源:https://stackoverflow.com/questions/17522296/jqgrid-retain-formatter-textbox-values-after-search-operation