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
multiple search dialogs, different searches
25/11/2011
16:40
Avatar
tempel
Member
Members
Forum Posts: 6
Member Since:
27/10/2011
sp_UserOfflineSmall Offline

hi, Iam having trouble with some custom search dialogs

my Pager is setup like this and works fine;

jQuery("#list5").jqGrid('navGrid', '#pager5',{view:false,edit:false,add:false,del:false,edit:false},{},{},{},{
                         closeOnEscape: true,
                         closeAfterSearch: true,
                         multipleSearch:true,
                         multipleGroup:true,
                         showQuery: true,
                         caption:"Search..."},{} );

We want our users to be able to store their search requests.

Therefore I want them to select the search options from the dialog -as always, but then store the postData somewhere on the server.

later on I need the postData (the search request) to be editable (preferably via the standard- search dialog )

So I made a click button like this:

$("#search_grid").click(function(){   
                 jQuery("#list5").jqGrid('searchGrid',{
                     closeOnEscape: true,
                     closeAfterSearch: true,
                     multipleSearch:true,
                     multipleGroup:true,
                     showQuery: true,
                     caption:"AN OTHER CAPTION"
                 });    
             });

Problem with that is: The "search" that is triggerd first sets the caption and the options , and the following actions do not set the new Caption/options. -> i cannot get around this atm.

Maybe I got something wrong here, and someone can point me towards a solution?!

If you have any ideas, how i can make the stored "postData/searchoptions"  load into the dialog again  -at a later time. Please give me a hint 😉

Thanks a lot !
tempel

25/11/2011
18:56
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Tempel,

the options recreateFilter: true of the searchGrid seems to me what you need to use.

By the way some time before I posted here the suggestion to change the default settings of recreateForm and recreateFilter from currently default value false to true. I still have the same opinion. At the beginning of my usage of jqGrid I spent at least two days in debugging some strange problems which origin was recreateForm setting. I read regelmassig problems like yours. I still hope that Tony will do the changes. Till the time I can recommend you to change jqGrid defaults by changing of $.jgrid.search. My personal default settings are

$.extend($.jgrid.search, {
    multipleSearch: true,
    multipleGroup: true,
    recreateFilter: true,
    closeOnEscape: true,
    closeAfterSearch: true,
    overlay: 0
}); 

You can set the settings which are the best to your project in one JavaScript file which you will includes on all your HTML pages directly after the jquery.jqGrid.min.js.

Best regards
Oleg 

28/11/2011
12:00
Avatar
tempel
Member
Members
Forum Posts: 6
Member Since:
27/10/2011
sp_UserOfflineSmall Offline

Thank you very much for your detailed post, oleg !!!

will try your solution rigth now! -deadline passed away one week ago 😉

01/12/2011
14:29
Avatar
tempel
Member
Members
Forum Posts: 6
Member Since:
27/10/2011
sp_UserOfflineSmall Offline

hi,

looking into the plugin source grid.formedit.js I found this:

var fl = $("#"+fid),

filters = fl.jqFilter('filterData');

When I use     console.log(JSON.stringify(filters)) I can see the filterStr like this:

{"groupOp":"AND","rules":[{"field":"RemoteAddress","op":"eq","data":""},{"field":"RemoteAddress","op":"eq","data":""}]}

this is what I need to get from my custom search box

Now I am trying to do the exact same thing for my "custom search box": (prevented the default functions from beeing executed)

and just do; filters = $("#test").jqFilter('filterData');

But this gives me the full postData obj plus the SearchFilter.

I think i need to do something like a clear/reset before using jqFilter("filterData")

any hints?

What I want do do is: modify this string, store it, then build my postData obj. and finally refresh my grid with this.

01/12/2011
14:37
Avatar
tempel
Member
Members
Forum Posts: 6
Member Since:
27/10/2011
sp_UserOfflineSmall Offline

what I was looking for was:

loadDefaults: false

Now I can just extract the filterStr.Cool

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
46 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