LoginSignup
2
2

More than 5 years have passed since last update.

jqGrid frozen column example(treegrid mode)

Last updated at Posted at 2016-03-15
treegrid.js
//jqgrid作成後に下記コードを実行(ツリーグリッドモードではfrozenはnot supportのようです)
//treegrid fixed column (treegrid frozen not supported) after create jqgrid Table

var pos = 3; // <- 左から何列固定させるか how many frozen
var $wrap = $(".ui-jqgrid-bdiv");
$wrap.scroll(function(e){
    var offset = $(this).scrollLeft();
          //$('#treegrid').jqgrid({...}) ならば #treegrid
    var sel = '#treegrid td:nth-child(-n+'+pos+'),thead th:nth-child(-n+'+pos+')';
          //#FFF と 10 は適宜書き換える
    $(sel).css({position:"relative",left:offset,background:"#FFF",zIndex:"10"});
});
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2