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
sortable and forceFit not working properly together
26/08/2011
13:47
Avatar
aexon
Member
Members
Forum Posts: 6
Member Since:
09/02/2010
sp_UserOfflineSmall Offline

Dear community,

when using the options sortable and forceFit it is possible to resize the width of the inner table, which should be avoided since forceFit is set to true. To reproduce this behaviour simply create a grid with sortable and forceFit set to true and resizable colums (default), switch the last two columns by dragging and dropping them and now resize the new last column by making it smaller (works only with making it smaller). The result is a _wider_ last column and a horizontal scrollbar in the inner table (the one with the id initially given).

When the table is initially rendered with forceFit turned on the last column is not resizable. I think to avoid exactly such a behaviour. But together with sortable columns (don't mix it up with data sorting) this safety mechanism is bypassed. The next to last (and resizable) column becomes the last column and makes it possible to widen the table.

So the basic idea behind this is to make another column the last column. Another way to achieve this is using the columnChooser. Simply hide the last column and again the column next to the (former) last column becomes the new last colum, which is, of course, resizable (by default).

I was confronted with this behaviour earlier (version 3.6.4) and solved it by maintaining the resizable status whenever the columns are remapped or a column's visibility changes.

There are two places to inspect:

  1. The remapColumns function (also in the latest version of jqGrid) and
  2. the afterSubmitForm event fired when closing the columnChooser (or the appropriate code in jqGrid, but I did not want to change this and handled the event instead)

What needs to be done is to maintain the resizable attribute of each column and whenever a resizable column becomes the last column to change it to "not resizable" by setting the colModel attribute resizable of this column to false. Of course whenever another column becomes the last column, the changed resizable attribute needs to be restored according to it's initialization value (as defined in the colModel).

BR

Kai

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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