|
|
Re: How to change the cell background color? [message #1517559 is a reply to message #1517408] |
Fri, 19 December 2014 15:39 |
Srinivas Umareddy Messages: 4 Registered: December 2014 |
Junior Member |
|
|
Hi Dirk,
I have used some custom rule and also IEditableRule.NEVER_EDITABLE. We override the getConfigLabelsByPosition() method in the DataLayer like below. Its working fine.
In my table editable/non editable is dynamic not the static and its controlled from other UI field in the same application. During the loading of the table, the entire table might be editable when the users change some option in the table or outside the table then we have to disable some columns cells in the row and paint cell with gray color.
In order to implements this requirement, I have override the datalayer like below. I found this is calling very time and repairing the cell. I was able to get the isEditable flag from the configuration.
Please let me know is this right approach.
bodyDataLayer = new DataLayer(bodyDataProvider)
{
@Override
public LabelStack getConfigLabelsByPosition(int columnPosition,
int rowPosition) {
// TODO Auto-generated method stub
LabelStack configLabel = super.getConfigLabelsByPosition(columnPosition, rowPosition);
ILayerCell layer = super.getCellByPosition(columnPosition, rowPosition);
IEditableRule editableRule = (IEditableRule)configRegistry.getConfigAttribute(
EditConfigAttributes.CELL_EDITABLE_RULE,
"EDIT", configLabel.getLabels());
boolean isEditable = editableRule.isEditable(layer, configRegistry);
if(isEditable)
{
getConfigLabelAccumulator().accumulateConfigLabels(configLabel, columnPosition, rowPosition);
configLabel.addLabelOnTop(MyUICommon.EDITABLE_LABEL);
}
else
{
getConfigLabelAccumulator().accumulateConfigLabels(configLabel, columnPosition, rowPosition);
configLabel.addLabelOnTop(MyUICommon.NONEDITABLE_LABEL);
}
return configLabel;
}
};
|
|
|
|
Powered by
FUDForum. Page generated in 0.03189 seconds