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_Related Related Topics sp_TopicIcon
Advanced Searching -> Saving Filters
25/01/2011
23:19
Avatar
dajaney
Member
Members
Forum Posts: 20
Member Since:
22/01/2010
sp_UserOfflineSmall Offline

I'm using Zend_Framework and have created a Zend_Plugin to register a jqGrid _search call and store the filters array into a Zend_Session_Namespace object.

When the user goes to another page and comes back to the original jqGrid instance, my controller will build the jqGrid object with the following snippet after the jqGrid construction:

$("#gridid").jqGrid("setGridParam", { sortname: "somevar", sortorder: "ASC", page: 1, rowNum: 20, search: true, postData: { "filters": {"groupOp":"AND","rules":[{"field":"somevar","op":"bw","data":"test"},{"field":"somevar2","op":"eq","data":"test2"}]}}}).trigger("reloadGrid");

Because I am storing these filters in a session my controller/model will perform the saved search on the database. When I open the advanced search modal it shows the appropriate filters that were stored/loaded except that the data element (form element) is not working correctly for those fields that are stype: "select" with a dataURL option. They are just text boxes with the select.val() and not select.text(), so it is showing a lot of primary_keys instead of the textual description of the selection. When I modify that existing filter by selecting another field and going back, the data (value) item still does not update to the dynamic select menu of items but stays a text box.

I figured out how to get rid of the default filter item (when loading saved filters) by adding the following to the searchGrid:

afterShowSearch:function(){ $(".sf").last().empty().remove();}

I've also had to manually attempt to update the $("#t_gridid") (top bar) for the "Search Results:" component...

jQuery("#gridid").setColProp("somevar",{searchoptions:{defaultValue:"someval"}});

var GText = jQuery("#gridid").getColProp("somevar");

$("#t_gridid").append(" "+GText.label+" ");

$("#t_gridid").append("'.$this->_op.'");

$("#t_dynagrid").append(""'.$this->_val.'";");

However this also does not show the full text representation of the "op" or the "val/data". It shows primary_keys and not the searchGrids select.text representation.

There has got to be a better way to save and load search filters.

Any ideas?

25/01/2011
23:28
Avatar
dajaney
Member
Members
Forum Posts: 20
Member Since:
22/01/2010
sp_UserOfflineSmall Offline

Some more information:

I have fought hard to use jqGrid in our application and have had to hack'n'slash here and there to get it working how our internal clients wanted it. Due to it's growing popularity we have now developed external facing applications utilizing the jqGrid object. So far everyone is impressed but now the feature enhancements are starting to roll in. (The main one is the saving of search filters).

Who can we pay money to for support?

Who can we pay money to for development help?

Tony, can we fly you out here and have you sit with us and hash some things out?

Thanks!

30/01/2011
21:35
Avatar
dajaney
Member
Members
Forum Posts: 20
Member Since:
22/01/2010
sp_UserOfflineSmall Offline

Bump, any input?

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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