In order to freeze a column, you need to define the FrozenColumns property. The Frozencolumn property is the same as the Columns property.
$ (' #tt ' ' Frozen Columns ' ' icon-save ' 500 height: 250 ' Data/datagrid_data.json ' , frozencolumns:[[{field: ' itemid ', title: ' Item ID ', Width:80}, {Fiel D: ' ProductID ', title: ' Product ID ', Width:80 ',]], columns:[[{Field: ' ListPrice ', title: ' List price ', width:80,align: ' Right ' ' UnitCost ', Title: ' Unit cost ', width:80,align: ' Right ' ' attr1 ', title: ' Attribute ' , Width:100 ' status ', title: ' Status ', Width:60} ]]});
You do not need to write any javascript code, so you can create a data
<table id= "tt" title= "Frozen Columns" class= "Easyui-datagrid" style= "width:500px;height:250px" url= "Data/datagrid_data.json" singleselect= "true" iconcls= "Icon-save" > <thead frozen= "true" > <tr> <th field= "itemid" width= ">item id</th> <th field=" ProductID "Width=" ">product id</th> </tr> </thead> <thead> <tr> <th Field= "ListPrice" width= "align=" "right" >list price</th> <th field= "UnitCost" width= "align=" Right ">unit cost</th> <th field=" attr1 "width=" >Attribute</th> <th field= " Status "width=" align= "center" >Stauts</th> </tr> </thead></table>
Easy UI DataGrid Setting frozen Columns