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.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top