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

    $('#tt').datagrid({   
        url: 'datagrid_data2.json',   
        title: 'DataGrid - ContextMenu',   
        width: 700,   
        height: 'auto',   
        fitColumns: true,   
        columns: [[   
            {field: 'itemid',title: 'Item ID', 80},   
            {field: 'productid',title: 'Product ID', 120},    
            {field: 'listprice',title: 'List Price', 80,align: 'right'},    
            {field: 'unitcost',title: 'Unit Cost', 80,align: 'center'},    
            {field: 'attr1',title: 'Attribute', 250},    
            {field: 'status',title: 'Status', 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

原文地址:https://www.cnblogs.com/hubing/p/4050175.html