[英]How to change background color of grid's dirty cells in Extjs
我想更改網格中臟單元格的樣式(背景顏色等)。 如何應用僅影響網格污垢單元的樣式?
使用以下CSS類名稱來更改臟單元格的某些屬性:
.x-grid3-dirty-cell {
background-image:none;
}
這將清除臟單元中的紅色角。這適用於ExtJs版本> = 3
如果要更改單元格的背景顏色,則必須使用x-grid3-cell-inner
,可以使用columnRenderer
,您可以在其中編寫邏輯。 編輯單元格后,將調用columnrenderer,然后您可以在其中檢查值是否已更改,使用更改顏色
function columnrenderer(value, meta,records,rowIndex,colIndex,store,view){
var column = view.getHeaderAtIndex(colIndex);
var dataIndex = column.dataIndex;
records.modified[dataIndex]; //Will give the original value
value; //gives the changed value
if(//both are not same)
return '<div class="x-grid3-cell" style="background-color:red;"><span >(' + value + ')</span></div>';
else
//do nothing
}
有關GridCellRenderer的更多信息,請參見ExtJs Grid FAQ。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.