EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Punkerr on February 07, 2013, 03:43:01 PM



Title: Frozen Column Edatagrid
Post by: Punkerr on February 07, 2013, 03:43:01 PM
Hi,

I have a little problem here, I tried a lot of ways but frozen columns doesn't work:

Code:
$('#dg').edatagrid({
    title: 'eDataGrid',
    width:400,
    height:250,
    singleSelect:true,
    frozenColumns:[[
        {field:'itemid',title:'Item ID',width:80},
        {field:'productid',title:'Product ID',width:100,editor:'text'},
    ]],
    Columns:[[
        {field:'listprice',title:'List Price',width:80,align:'right',editor:{type:'numberbox',options:{precision:1}}},
        {field:'unitcost',title:'Unit Cost',width:80,align:'right',editor:'numberbox'}
    ]],
    view:detailview,
    detailFormatter: function(rowIndex, rowData){
         return '<div style="padding:5px">' +
                '<p>Attribute: ' + rowData.attr1 + '</p>' +
                '<p>Status: ' + rowData.status + '</p>' +
                '</div>';
    }
    
}).edatagrid('loadData', [
    {"productid":"FI-SW-01","unitcost":10.00,"status":"P","listprice":16.50,"attr1":"Large","itemid":"EST-1"},
    {"productid":"K9-DL-01","unitcost":12.00,"status":"P","listprice":18.50,"attr1":"Spotted Adult Female","itemid":"EST-2"},
    {"productid":"RP-SN-01","unitcost":12.00,"status":"P","listprice":18.50,"attr1":"Venomless","itemid":"EST-3"},
    {"productid":"RP-LI-02","unitcost":12.00,"status":"P","listprice":18.50,"attr1":"Green Adult","itemid":"EST-5"},
    {"productid":"FL-DSH-01","unitcost":12.00,"status":"P","listprice":58.50,"attr1":"Tailless","itemid":"EST-6"},
    {"productid":"FL-DSH-01","unitcost":12.00,"status":"P","listprice":23.50,"attr1":"With tail","itemid":"EST-7"},
    {"productid":"FL-DLH-02","unitcost":12.00,"status":"P","listprice":93.50,"attr1":"Adult Female","itemid":"EST-8"},
    {"productid":"FL-DLH-02","unitcost":12.00,"status":"P","listprice":93.50,"attr1":"Adult Male","itemid":"EST-9"},
    {"productid":"RP-SN-01","unitcost":12.00,"status":"P","listprice":18.50,"attr1":"Rattleless","itemid":"EST-4"},
    {"productid":"AV-CB-01","unitcost":92.00,"status":"P","listprice":193.50,"attr1":"Adult Male","itemid":"EST-10"}
]);

Sworthy, any idea here?? thx in advance!!


Title: Re: Frozen Column Edatagrid
Post by: stworthy on February 08, 2013, 06:29:55 AM
Please refer to this example http://jsfiddle.net/xTQ9e/. It works fine.


Title: Re: Frozen Column Edatagrid
Post by: Punkerr on February 08, 2013, 10:55:23 AM
Thanks sworthy, my bad  :-\ I finished the last frozen column line in comma... big mistake.
Another question, ¿is there another way to put the detail info at the frozen columns side?... default position is behind other rows side.


Title: Re: Frozen Column Edatagrid
Post by: Punkerr on February 11, 2013, 09:43:52 AM
 ¿Is there another way to put the detail info at the frozen columns side?... default position is behind other rows side.