Extjs grid 設置行字體顏色


CustSuppGrid = Ext.create('Ext.grid.Panel', {
                title : '', // 標題頭
                iconCls : 'icon-grid', // 標題圖標
                store : CustSuppStore, // 數據源
                frame : false, // True 為 Panel 填充畫面,默認為false
                forceFit : false, // 設置為true,則強制列自適應成可用寬度
                selType : 'checkboxmodel',
                columnLines : true, // 添加列的框線樣式
                viewConfig : {
                    stripeRows : true, // 在表格中顯示斑馬線
                    enableTextSelection : true,
                    getRowClass : function(record, rowIndex, rowParams, store){ //根據狀態改變當前行字體顏色
                        var csStatus = record.get('csStatus');
//             record.data.csStatus == '停用'
if ('停用' == csStatus) { return 'x-grid-row-red'; } } }, columns : [Ext.create('Ext.grid.RowNumberer', { width : 30, resizable : true }), { text : '記錄ID', tooltip : '記錄ID', dataIndex : 'id', width : 100, sortable : true, hidden : true }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM