javascript - JQgrid FreezeColumn not freezing headers? -
i new jqgrid , have been attempting freeze first column in grid horizontal scrolling not effect column.
i have frozen: true
in colmodel
, calling jquery("#grid").jqgrid('setfrozencolumns');
.
this correctly freezes column data, scroll right, column headers scroll me. how can freeze headers too?
thank much!
sample code:
jquery("#taskgrid").jqgrid({ datatype: "jsonstring", colnames:['task id','task name', 'role info'], colmodel:[ {name:'taskid',index:'taskid', width:100, frozen: true}, {name:'taskname',index:'taskname', width:200}, {name: 'roleinfo.1', index: 'roleinfo.1', width:100, formatter: 'checkbox' } ], jsonreader: {repeatitems: false}, datastr: json.parse(document.form.taskdata.value), rownum:50, pager: '#pager2', sortname: 'taskid', viewrecords: true, sortorder: "desc", caption:"json example", height: "750", width: "350", shrinktofit: false });jquery("#taskgrid").jqgrid('setfrozencolumns');
try use free jqgrid 4.13.4 instead of guriddo jqgrid js 5.1.0, use currently. first of includes many fixes in frozen columns, contains many enhancements , free in opposite guriddo jqgrid js (see prices here). try free jqgrid can use load jqgrid directly cdn (see the wiki article).
i'd recommend additionally use datatype: "local"
, data: jquery.parsejson(document.form.taskdata.value)
instead of datatype: "jsonstring"
, datastr
. datatype "jsonstring"
if need to prevent local sorting of input data during initial loading. if use datatype: "local"
input data sorted locally based on sortname: 'taskid'
, sortorder: "desc"
before there displayed.
Comments
Post a Comment