在JQGrid中冻结rownum列 [英] Freeze rownum column in JQGrid

查看:251
本文介绍了在JQGrid中冻结rownum列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个webapp,它使用JQGrid表,我想使用带有格式化程序的冻结列:action和rownumber列(rn列)。可以看到冻结行的高度将在内联编辑的开始或结束时自动调整:





所以你需要从 GitHub 来解决您的问题。


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: trueproperty 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.

解决方案

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.

这篇关于在JQGrid中冻结rownum列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆