我有 jqgrid :
jQuery("#list").jqGrid( {
url : 'ajax/get',
datatype : 'json',
mtype : 'POST',
colNames : [
'Date',
'ID'
],
colModel : [{
name : 'date',
index : 'date',
width : 60,
align : 'center',
searchoptions:{sopt:['gt', 'lt']}
},{
name : 'id',
index : 'id',
width : 40,
align : 'center',
searchoptions:{sopt:['eq']}
}]
//.......
});
有没有办法在“日期”列中设置“odata”选项。现在它显示“更大”和“更少”。我需要-“从”和“到”。
我试试这个:
colModel : [{
name : 'date',
index : 'date',
width : 60,
align : 'center',
searchoptions:{sopt:['gt', 'lt'], odata:['from', 'to']}
}
它不起作用,仍然显示“更大”和“更少”。试过这个:
$(document).ready(function(){
$.jgrid.search = {
odata : ['equal','not equal', 'to', 'less or equal','from','greater or equal', 'begins with','does not begin with','is in','is not in','ends with','does not end with','contains','does not contain']
};
$.extend($.jgrid.search);
});
它在所有列中将“大于”替换为“从”,将“小于”替换为“到”,但我只需要在“日期”列中。有没有办法做到这一点?
谢谢。