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
Unsortable headers get ui-jqgrid-sortable css class
17/09/2009
13:00
Avatar
pbor
Member
Members
Forum Posts: 33
Member Since:
01/09/2009
sp_UserOfflineSmall Offline

Even if a Column is not sortable, it still gets the ui-jqgrid-sortable css class.

This patch fixes it:

From f2d851e6e93a498a34b0efe32975c75079b873bf Mon Sep 17 00:00:00 2001
From: Paolo Borelli <pborelli@gnome.org>
Date: Thu, 17 Sep 2009 19:53:40 +0200
Subject: [PATCH 1/2] Do not mark unsortable cols with sortable css class

---
 js/grid.base.js |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/js/grid.base.js b/js/grid.base.js
index 36365a5..81bb7b6 100644
--- a/js/grid.base.js
+++ b/js/grid.base.js
@@ -1150,11 +1150,11 @@ $.fn.jqGrid = function( p ) {
             sort = ts.p.colModel[j].sortable;
             if( typeof sort !== 'boolean') {ts.p.colModel[j].sortable =  true; sort=true;}
             var nm = ts.p.colModel[j].name;
-            if( !(nm == 'cb' || nm=='subgrid' || nm=='rn') ) {
-                if(ts.p.viewsortcols[2])
-                    $("div",this).addClass('ui-jqgrid-sortable');
-            }
             if(sort) {
+                if( !(nm == 'cb' || nm=='subgrid' || nm=='rn') ) {
+                    if(ts.p.viewsortcols[2])
+                        $("div",this).addClass('ui-jqgrid-sortable');
+                }
                 if(ts.p.viewsortcols[0]) {$("div span.s-ico",this).show(); if(j==ts.p.lastsort){ $("div span.ui-icon-"+ts.p.sortorder,this).removeClass("ui-state-disabled");}}
                 else if( j == ts.p.lastsort) {$("div span.s-ico",this).show();$("div span.ui-icon-"+ts.p.sortorder,this).removeClass("ui-state-disabled");}
             }
--
1.6.2.5

18/09/2009
03:23
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Thanks for this investigation. I know for this and maybe it will stay so.

Do not think that this is a bug. The reason is that you have dynamicall sorting columns. Also using setColProp make this possible.

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.

18/09/2009
04:57
Avatar
pbor
Member
Members
Forum Posts: 33
Member Since:
01/09/2009
sp_UserOfflineSmall Offline

Mmm.. ok I'll look into setColProp.

However I think the current behavior is unintuitive... if there are dynamically sortable columns, maybe the css class should be dynamically set too. Just to give context, I want to tweak my css to not show the unsortable columns as clickable, which I think it is a common choice.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
66 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