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 disable sortable (dragging columns) on an existing grid?
28/08/2014
18:55
Avatar
ilagi
Member
Members
Forum Posts: 6
Member Since:
12/06/2014
sp_UserOfflineSmall Offline

Hi,

I'm trying to disable the dragging of columns on an existing grid by setting sortable to false, but it doesn't work.

jQuery('#mygrid').jqGrid('setGridParam', {sortable: false});

 

Any idea how to disable the drag-and-dropping of columns of an existing grid?

 

Thanks

29/08/2014
11:35
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

 

Unfortunately there is no function which disable the sorable.

The way you try is not correct since the script (when this option is true) executes once and bind the needed events of the sortable.

The only possible solution is to use $(element).sortable('destroy').

 

I'm not sure if this will work correct, but you can try this code:

(I get this code from the gridbase)

var thead = $("thead:first","#grid" ).get(0),

thr = $("tr:first",thead);

$(thr).sortable('destroy');

 

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.

29/08/2014
17:04
Avatar
ilagi
Member
Members
Forum Posts: 6
Member Since:
12/06/2014
sp_UserOfflineSmall Offline

Hi Tony,

Thanks, unfortunately that didn't work (it was complaining about sortable not being initialized), so I checked the DOM and modified and now it works:

 

var thead = $("thead:first","#grid" ).get(0),
thr = $("tr.jqg-second-row-header",thead);
$(thr).sortable('destroy');

 

Thanks!

13/09/2014
13:11
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

 

Thank you for posting this.

 

Best 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:
47 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