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
Column chooser with database
16/06/2014
09:08
Avatar
JqUsername
Member
Members
Forum Posts: 3
Member Since:
16/06/2014
sp_UserOfflineSmall Offline

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.

19/06/2014
12:00
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

You can use

$.ajax({
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.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information