Forum


00:20

30/03/2009

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!
03:48

Moderators
30/10/2007

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.
09:10

30/03/2009

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!
00:22

30/03/2009

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!
07:06

Moderators
30/10/2007

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.
01:41

26/04/2009

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.
07:23

26/04/2009

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.
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66