使用本地数据将冻结设置为 jqGrid 的前两列。其中 colModel 和 colNames 是动态绑定的

Set frozen to first two column of jqGrid using local data. where colModel and colNames are dynamically bound

通过在 colModel 中设置列​​ frozen : true 和 打电话

jquery(your_jqgridName).jqGrid('setFrozenColumns');

在这种情况下它不起作用。

看来你必须在 jquery 中输入大写字母 Q:

 jQuery(your_jqgridName).jqGrid('setFrozenColumns');
//^----here

Limitations

The following limitations tell you when frozen columns can not be set-up

  1. When TreeGrid is enabled
  2. When SubGrid is enabled
  3. When cellEdit is enabled
  4. When inline edit is used - the frozen columns can not be edit.
  5. When sortable columns are enabled - grid parameter sortable is set to true or is function
  6. When scroll is set to true or 1
  7. When Data grouping is enabled
  8. When footer row (footerrow paremeter) is enabled

来自 Here

中的答案

将其添加到设置的冻结列下方。

$grid[0].p._complete.call($grid[0]);

其中 $grid 定义为 var $grid = $('#list');.