Reputation: 1892
I have a webapp, which uses JQGrid table and I would like to freeze the rownum column just like any other column but I can't because there's no access to the rownum colModel and it's impossible to set freeze: true
property of a rownum.
Here's my JSFiddle with a working example, which is correct, except that it freezes both rownum and Inv No columns and I would like to freeze only the first column. To check the column freeze: just resize the JSFiddle window in such way that a table get's horizontal scrollbar and reload the fiddle.
Does anyone know how to achieve this? Every useful answer (especially JSFiddle) is highly appreciated and evaluated.
Thank you.
Upvotes: 3
Views: 1656
Reputation: 221997
I find your suggestion interesting. jqGrid don't allows to make "rn"
(created in case of the usage of rownumbers: true
option) or "cb"
(created in case of the usage of multiselect: true
option) columns frozen. As you probably know I develop my fork of jqGrid since last 4 month under the name free jqGrid (see readme and wiki for more details). So I just made the corresponding changes in the code of setFrozenColumns
in my fork.
The demo demonstrates the feature. The columns "rn"
and "cb"
have frozen: true
column by default. So one need just call setFrozenColumns
method to make there frozen:
An additional problem with frozen columns is the position and the height of individual rows if not all rows have the same height. For example inline editing can increase the height of row. I fixed the problem too.
The next demo uses frozen column with formatter: "action"
and the "rownumber" column ("rn" column). One can see that the height of frozen rows will be automatically adjusted on the start or the end of inline editing:
So you need just download the latest code of free jqGrid from GitHub to solve your problem.
Upvotes: 1