Forum

July 10th, 2011
You must be logged in to post Login Register

Search Forums:


 






Is there a way to customize search rules in jqGrid in particular column?

UserPost

11:18
23/07/2010


andser

New Member

posts 1

Post edited 08:19 – 23/07/2010 by andser
Post edited 08:19 – 23/07/2010 by andser
Post edited 08:22 – 23/07/2010 by andser
Post edited 08:24 – 23/07/2010 by andser


Hi!

I have 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']}  
}]  
//.......  
});

Is there a way to set "odata" option in "Date" column. Now it's showing "greater" and "less". I need – "from" and "to".

I try this :

colModel : [{  
name : 'date',  
index : 'date',  
width : 60,  
align : 'center',  
searchoptions:{sopt:['gt', 'lt'], odata:['from', 'to']}  
}

It's not working, still showing "greater" and "less". Tried this :

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

It's replaces "greater" to "from" and "less" to "to" in all columns, but I need only in "Date" column. Is there a way to do it?

Thanks.


About the jQuery Grid Plugin – jqGrid forum

Most Users Ever Online:

157


Currently Online:

112 Guests

Forum Stats:

Groups: 1

Forums: 7

Topics: 9590

Posts: 28781

Membership:

There are 10159 Members

There have been 448 Guests

There is 1 Admin

There are 2 Moderators

Top Posters:

OlegK – 1157

markw65 – 179

kobruleht – 144

phicarre – 126

YamilBracho – 124

Renso – 118

Administrators: admin (56 Posts)

Moderators: tony (7009 Posts), Rumen[Trirand] (81 Posts)




Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information