目的: V60202Q – Grid欄位顏色- 欄位允許編輯 –依欄位值,設定字體顏色
處理說明: 1>
1>*.js
{
header: "領用數量", dataIndex: "USED_QTY", width: 100, sortable: false, TMType: "string",
style: 'color: blue;',
editor: { xtype: 'textfield', },
},
grid_id: 'sub_Grid',
columns: sub_Columns_V60202Q,
//autoScroll: true,
flex: 1,
store: Ext.create('gridstore', { model: sub_model_V60202Q }),
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', { // 不會出現[Update][Cancel]鈕, 直接編輯
clicksToEdit: 1, // 按一下進行編輯,預設為按兩下
clicksToMoveEditor: 1,
})],
});
2>V80202.js - 依欄位值,設定字體顏色
{header:"是否曾展BOM",dataIndex:"ISBOMIN",width:100,sortable:false,TMType:"string"},
{
header: "停工中",
dataIndex: "ISSTOP", width: 60, sortable: false, TMType:
"string",
style: 'color: blue;'
, // 設定標題文字顏色
// 設定欄位值.顏色
renderer: function
(value) {
if (value ==
"Y") {
return "<span style='color:red'>" + value +
"</span>";
}
else {
return value;
}}},
{header:"專案委託人",dataIndex:"PJER",width:100,sortable:false,TMType:"string"},