Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Help setting specific column and operator in popup search dialog.
18/01/2013
09:18
Avatar
nelsonm
Michigan, USA
Member
Members
Forum Posts: 106
Member Since:
20/08/2011
sp_UserOfflineSmall Offline

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

19/01/2013
09:41
Avatar
nelsonm
Michigan, USA
Member
Members
Forum Posts: 106
Member Since:
20/08/2011
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information