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
How to get updated list into surl for select?
16/04/2009
00:20
Avatar
Clement
Member
Members
Forum Posts: 48
Member Since:
30/03/2009
sp_UserOfflineSmall Offline

Hi,

I have setup filterModel to fetch the select list from a server page. However, the list changes over time. I notice that the list of values fetched by url is not updated after the server file is updated.

How can I get surl to read the list of values again once I click on the search button?

Thanks!

16/04/2009
03:48
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Yes this only once. In order to update the list you should make your own code to obtain the values from server and set it in the searchFilter.

Another possible solution is to empty the filter and create it agian.

Regards

Tony

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.

16/04/2009
09:10
Avatar
Clement
Member
Members
Forum Posts: 48
Member Since:
30/03/2009
sp_UserOfflineSmall Offline

Hi Tony,

Yes, I did the latter by setting the setting the filter div to the original state when the filter layer hides and add the filter again when it shows.

onHeaderClick: function (stat) { if(stat == 'visible' ){ //jQuery("#filter").html("Queue Selector");
        jQuery("#filter").css("display","none"); } }

.navButtonAdd("#pager",{caption: "",title:"Queue Selector",buttonimg:"images/queue_select.gif", onClickButton:function(){
        if(jQuery("#filter").css("display")=="none") {       jQuery("#filter").filterGrid("list", { filterModel:[{label:'Queue', name: 'queue', stype: 'select', surl: 'Filter-Queue.csv'}], formtype:'vertical', enableSearch:true, enableClear:true, autosearch: false, afterSearch: function() { jQuery(".HeaderButton").trigger("click"); jQuery("#filter").css("display","none"); } } );
        jQuery(".HeaderButton").trigger("click"); jQuery("#filter").show(); }
        }
        });

However, I lost the previous filter selections. How can I reselect those values in the select element after I add the filter again? I thought of passing the current values (collected via userdata previously) back to the server page that generates the select html at surl to set those options as selected but not sure if there is a better way.

Thanks!

17/04/2009
00:22
Avatar
Clement
Member
Members
Forum Posts: 48
Member Since:
30/03/2009
sp_UserOfflineSmall Offline

Just to add on..

I am using a search form with a single select element which has its 5000+ values populated via surl, defined in filterModel. This form is done with reference to “Multiple Form Search” at http://trirand.com/jqgrid/jqgrid.html under “New in version 3.3″.

As the list of values in the select is quite large and it would take a while to load, is that any method/event I can use to know that the select is ready?

This is necessary so that I can automatically select those values selected previously. I am passing the previous selected values back to the grid via userdata.

Thanks!

17/04/2009
12:03
Avatar
Clement
Member
Members
Forum Posts: 48
Member Since:
30/03/2009
sp_UserOfflineSmall Offline

I realized I could get the list of previous selected items by $("#list").getPostDataItem("param_name") instead of passing back with userdata. This saved some network bandwidth..

However, I still haven't figure out how to know when the select element populated via surl is ready..

20/04/2009
20:30
Avatar
Clement
Member
Members
Forum Posts: 48
Member Since:
30/03/2009
sp_UserOfflineSmall Offline

Hi Tony,

Any advice on how we could tell the the search form in "Multiple Form Search" demo is ready?

Thanks!

22/04/2009
07:06
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

The search uses the jquery load - you can use ajaxStart and ajaxStop when (maybe you can use here a blockUI plugin) calling the search - and notify the user when the ajax is ended.

Regards

Tony

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.

23/04/2009
09:52
Avatar
Clement
Member
Members
Forum Posts: 48
Member Since:
30/03/2009
sp_UserOfflineSmall Offline

Thanks for the advice! I'll try it out..

27/04/2009
01:41
Avatar
dac60x
Member
Members
Forum Posts: 10
Member Since:
26/04/2009
sp_UserOfflineSmall Offline

Hi,

First of all, I would like to thank for this amazing plugin!. Now go with my problem:

I have a grid with 7 fileds, one of them is a select with too many values. I would like to know how to get all the values from a url like surl but when the grid is loaded (at the begining), not when I'm using filter search like these examples.

Thanks.

27/04/2009
07:23
Avatar
dac60x
Member
Members
Forum Posts: 10
Member Since:
26/04/2009
sp_UserOfflineSmall Offline

dac60x said:

Hi,

First of all, I would like to thank for this amazing plugin!. Now go with my problem:

I have a grid with 7 fileds, one of them is a select with too many values. I would like to know how to get all the values from a url like surl but when the grid is loaded (at the begining), not when I'm using filter search like these examples.

Thanks.

You can do it usen userData and loadComplete funtion:

loadComplete : function(){
      var gfhs = jQuery("#s1instancia").getGridParam('userData');
      $('#s1instancia').setColProp('gfh',{editoptions:{value:gfhs}});
    },

Where gfh is the name of the column in colModel.

Thanks anyway.


Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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