Forum


09:18

20/08/2011

Hi all,
I added a new button on the nav bar to open an alternate search dialog using:
function setFilterByCustomer(grid){
$('#'+grid+'_toppager_left').append("<input id='FilterByCustomer' type='button' value='Filter By Customer' style='height:22px; margin-left:5px;'/>");
$('#'+grid+'_toppager_left input#FilterByCustomer').click( function(){
$(grid).jqGrid ('searchGrid', {multipleSearch:true});
});
}
All i want to do is have the search dialog pop up with a specific column and operator selected.
Is there an option i can use to select the a specific column and operator in the search dialog before or as it opens?
thanks
09:41

20/08/2011

Ok, i figured it out.
If you need to initially preselect and display a specific column, operator and/or a value in a search dialog…
1. For the default search dialog, simply add the grid option:
postData:{'filters':{'groupOp':'AND/OR','rules':[{'field':'column','op':'operator','data':''}]}},
to the grid definition.
2. For additional search buttons in the nav bar, use:
function setFilterByCustomer(grid){
$(grid+'_toppager_left').append("<input id='FilterByCustomer' type='button' value='Filter By Customer' style='height:22px; margin-left:5px;'/>");
$(grid+'_toppager_left input#FilterByCustomer').click( function(){
$(grid).jqGrid('setGridParam',{postData:{'filters':{'groupOp':'AND/OR','rules':[{'field':'column','op':'operator','data':''}]}}});
$(grid).jqGrid ('searchGrid', {options})
});
}
3. Substitute the colored parts with the appropreate info.
Most Users Ever Online: 715
Currently Online:
45 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66