Jun 01, 2015, 8:19 AM
[CLOSED] how to add a css class to a cell of gridpanel?
I want to show a gridpanel , when a cell of gridpanel is empty or null , the cell's border color is red.
i try to use render for the column
i try to use render for the column
<ext:GridPanel runat="server" ID="gdHouseCenter" Title="XXX" ForceFit="True" >
...
<ext:Column runat="server" DataIndex="Unit" Text="所属å•å…ƒ" CellCls="" >
<Renderer Fn="emptyShow"></Renderer>
<Editor>
<ext:TextField runat="server"></ext:TextField>
</Editor>
</ext:Column>
var emptyShow = function(value,metadata,record,rowIndex,colIndex,store,view) {
if (value === null) {
var dataIndex = App.gdHouseCenter.colModel.getDataIndex(colIndex);// here is error , how to correct it?
var color = record.data.colors[dataIndex];
color.colorCls = 'empcls'; //here set a class for the cell , is it right?
}
return value;
}
Last edited by Daniil; Jun 08, 2015 at 10:11 AM.
Reason: [CLOSED]