我有一个选择类型,其值如下。sopt 是“cn”,所以当我选择“已批准”时,它也会给我“未批准”的结果,我怎样才能获得完全匹配的结果,即已批准为已批准,未批准为未批准等。下面是代码:
var categories = ["All", "Approved", "Not Approved", "Pending"];
var categoriesStr = ":All;Approved:Approved;Not Approved:Not Approved;Pending:Pending";
var defaultCategory = "All";
{name:'Status',index:'Status', width: 85, stype: 'select', sortable:false,
searchoptions:
{
sopt: ['cn'],
dataInit:function(el){
var defOption = $("option:contains("+defaultCategory+")",el);
defOption.attr("selected", "selected");
setTimeout(function(){
$(el).trigger('change');
},500);
}
},
edittype:'select', editoptions: { value: categoriesStr }
}