Changing display value for ListGrid field when value not present in valueMap

Hi, I have a selectItem in a ListGrid. I’ve noticed that when the row is not editable, the value for that field has to map to one of the options in the selectItem. If it does not, then for the field definition below, it just displays the raw fundAssetID. Is there anyway to define this ListGridField to display a different value when the row is not editable and the value is not present in the valueMap? Something like a displayField attribute that I’ve seen for optionDataSources but that would apply to a valueMap as well?

		{name:"fundAssetID", editorType:"selectItem", align:"left",valueMap:tradeBlotterValueMap,showIf:"return (tradeBlotterValueMapLength > 0);", prompt:"<spring:message code="desc.tradeblotter.asset"/>"},

Well, there needs to be some way to map your findAssetID to a displayable value. Generally that’s either a valueMap or an optionDataSource. It sounds like you’re saying you want to use a static valueMap when the field is editable, but an optionDataSource when it’s not editable. Is that right?

Why not simply use an optionDataSource? If you need to additionally restrict the filterCriteria when the user is typing, you could implement a custom getPickListFilterCriteria() on the field.

Well, an optionDataSource wouldn’t work because I’m not loading this valueMap from a DataSource. But, I figured out what I needed. I just needed to use formatCellValue to display the attributes I needed when the row is not being edited. And, looking at optionDataSource helped me see that alternative. Thanks.

That’s a good approach. Another that just occurred to me is to use a client-only DataSource (described here): http://www.smartclient.com/docs/5.6/a/b/c/go.html#group..clientOnlyDataSources as the optionDataSource, but this would effectively be a static valueMap.

The formatCellValue approach is more flexible since you could derive the display values dynamically.

Anyway, glad you have it working the way you need it.