浅谈datagrid详细操作单元格样式

    $('#tt').datagrid({   
        url: 'datagrid_data2.json',   
        title: 'DataGrid - ContextMenu',   
        width: 700,   
        height: 'auto',   
        fitColumns: true,   
        columns: [[   
            {field: 'itemid',title: 'Item ID',width: 80},   
            {field: 'productid',title: 'Product ID',width: 120},    
            {field: 'listprice',title: 'List Price',width: 80,align: 'right'},    
            {field: 'unitcost',title: 'Unit Cost',width: 80,align: 'center'},    
            {field: 'attr1',title: 'Attribute',width: 250},    
            {field: 'status',title: 'Status',width: 60,align: 'center'}   
        ]],   
        onLoadSuccess: function(data){   
            var panel = $(this).datagrid('getPanel');   
            var tr = panel.find('div.datagrid-body tr');   
            tr.each(function(){   
                var td = $(this).children('td[field="unitcost"]');   
                td.children("div").css({   
                    "text-align": "right"  
                });   
                ;   
            });   
        }   
    });  

浅谈datagrid详细操作单元格样式http://www.easyui.info/archives/470.html

posted @ 2014-10-25 15:23  北斗极星  阅读(485)  评论(0编辑  收藏  举报