Forum
09:08
16/06/2014
Hi,
Â
I have some cases where I have a lot of columns, so naturally - I use column chooser - but I also want that the DB backend to select the appropriate columns.
For that, I need to know each time column chooser submit - and the columns chosen.
I managed to do that...
jQuery("#scroll37").jqGrid ('navButtonAdd','#pscroll37',{
 caption: "", buttonicon: "ui-icon-calculator", title: "choose columns",
 onClickButton: function() {
  jQuery("#scroll37").jqGrid('columnChooser', {
   done: function(perm) {
     if (perm) {
       alert("The column chooser closed with 'OK' button");
       var cols = [];
       $.each(
       $('#scroll37').jqGrid('getGridParam', 'colModel'),
       function () {
       if (!this.hidden && !this.hidedlg) {
         cols.push(this.index);
         alert(this.index);
         alert(this.name);
         //problem here: $("#scroll37").trigger("reloadGrid");
       }
     }
   );
 } else {
  alert("The column chooser closed with 'Cancel' button");
  }
}});
}});
The problem is where it says "//problem here" in the code:Â After I know which columns were selected, I want to respond to the event. If I refresh the grid, it resets itself completley (even if I were at the bottom of the grid, it will load it all again)... So I'm looking for a way to trigger the call to the url - and of course I want to be able to pass parameters (to pass the columns).
Â
So something like this:
$("#grid").jqgrid('callUrl','myUrl?columns=a,b,c');
But haven't been able to find such API.
Thank you.
12:00
Moderators
30/10/2007
Hello,
You can use
url: 'yoururl',
data: 'yourdata',
...
});
See jQuery docs.
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.
Most Users Ever Online: 715
Currently Online:
52 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