I need to override a style for a pick list record similar to recodr style override in a list grid (example: http://www.smartclient.com/smartgwt/showcase/#grid_appearance_hilite_replace)
Unfortunaltely the method getPickListBaseStyle doesnt provide a record to be accessed for a value check.
I've tried also to use a regular grid with Override on getBaseStyle as below but that doesn't work for me too.
Do You have a clue on how to achieve this on a PickList?
Is it possible to do it same way as on a ListGrid?
ComboBoxItem carRegoCb = new ComboBoxItem();
ListGridField regNo = new ListGridField(Fields.Car.REGO_NO, messages.labCarRegoNo(),90);
ListGridField carBodyName = new ListGridField(Fields.Car.CAR_BODY_NAME, messages.labCarBodyType(),90);
ListGrid g = new ListGrid(){
@Override
protected String getBaseStyle(ListGridRecord record, int rowNum, int colNum) {
try{
if (!record.getAttributeAsBoolean(Fields.Car.IS_BODY_MATCHED)
||!record.getAttributeAsBoolean(Fields.Car.IS_WEIGHT_MATCHED) )
return "redBack";
else if(record.getAttributeAsBoolean(Fields.Car.IS_BODY_MATCHED)
&&record.getAttributeAsBoolean(Fields.Car.IS_WEIGHT_MATCHED)
&&record.getAttributeAsBoolean(Fields.Car.IS_PLAN_MATCHED)){
return "greenBack";
} else
return super.getBaseStyle(record, rowNum, colNum);
}catch(Exception e){
return super.getBaseStyle(record, rowNum, colNum);
}
}
};
g.setFields(regNo, carBodyName);
g.setWidth(carRegoCb.getPickListWidth());
carRegoCb.setPickListFields(regNo, carBodyName);
carRegoCb.setPickListProperties(g);
Unfortunaltely the method getPickListBaseStyle doesnt provide a record to be accessed for a value check.
I've tried also to use a regular grid with Override on getBaseStyle as below but that doesn't work for me too.
Do You have a clue on how to achieve this on a PickList?
Is it possible to do it same way as on a ListGrid?
ComboBoxItem carRegoCb = new ComboBoxItem();
ListGridField regNo = new ListGridField(Fields.Car.REGO_NO, messages.labCarRegoNo(),90);
ListGridField carBodyName = new ListGridField(Fields.Car.CAR_BODY_NAME, messages.labCarBodyType(),90);
ListGrid g = new ListGrid(){
@Override
protected String getBaseStyle(ListGridRecord record, int rowNum, int colNum) {
try{
if (!record.getAttributeAsBoolean(Fields.Car.IS_BODY_MATCHED)
||!record.getAttributeAsBoolean(Fields.Car.IS_WEIGHT_MATCHED) )
return "redBack";
else if(record.getAttributeAsBoolean(Fields.Car.IS_BODY_MATCHED)
&&record.getAttributeAsBoolean(Fields.Car.IS_WEIGHT_MATCHED)
&&record.getAttributeAsBoolean(Fields.Car.IS_PLAN_MATCHED)){
return "greenBack";
} else
return super.getBaseStyle(record, rowNum, colNum);
}catch(Exception e){
return super.getBaseStyle(record, rowNum, colNum);
}
}
};
g.setFields(regNo, carBodyName);
g.setWidth(carRegoCb.getPickListWidth());
carRegoCb.setPickListFields(regNo, carBodyName);
carRegoCb.setPickListProperties(g);