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
Users creating and saving filters
17/04/2014
20:41
Avatar
rbruhn
New Member
Members
Forum Posts: 2
Member Since:
17/04/2014
sp_UserOfflineSmall Offline

I've been looking around for a good jquery table and came across jqGrid. It seems like a very useful tool. One thing I was hoping to find is the ability for users to create a filter, name it, save it, and then access it later for other datasets. 

I've seen the Search Templates, so understand the filters can be created, named, and saved in some manner. However, it would be better if the user could use various search features, find what they like, then save and name the search for later.

Would it be hard to do something like that? Is there some way already?

18/04/2014
11:52
Avatar
jan-kratochvil
Member
Members
Forum Posts: 8
Member Since:
17/04/2014
sp_UserOfflineSmall Offline

This seems like a good feature...

19/04/2014
12:05
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

This is possible and requiere a little programing effort to make this happen.

The search rules are a parameter in the grid postData and this parameter is named filters.

Every time the user perform a serach you can save the filter using

var currentfilter = $("#grid").jqGrid('getGridParam','postData').filters;

this filter can be saved depending on your needs and later you can invokethe serech this way

$("#grid").jqGrid('setGridParam',{postData: { filters : currentfilter }, search:true });

$("#grid").trigger("reloadGrid");

Hope this help

Regards

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

21/04/2014
20:04
Avatar
rbruhn
New Member
Members
Forum Posts: 2
Member Since:
17/04/2014
sp_UserOfflineSmall Offline

Thank you for the information.

Instead of trying to save each search a user performs, which they may not wish to keep, is there a way to add a button to the search form so they can click, name, and save the search?

Or, even a custom form on the html page that captures the filter information and allows them to save. I guess that is how I might do it with the information you gave me.

I know there would need to be some backend process for saving (php, mysql, etc) which can be built. 

22/04/2014
11:50
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Currently there is no such button on the search form.

As for the custom form you can make a button in the page and make it so that when the user click on it to save the curren filter.

You my ask for the name to be saved and then save

var filters =[];

$("#mybutton").click(function(){

// ask the user to enter a short name let say

var currentname = 'test1';

// get the filter

var currentfilter = $("#grid").jqGrid('getGridParam','postData').filters;

// push it into array

filters[currentname] =  currentfilter ;

// you vcan save it to server using ajax.

alert('Current filter is saved!');

});

The way to run the saved filter is to read this array and when the user select the desired filter to run the code from my previous mail.

Regards

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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