Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Group Title

    I am sorry if this is a silly question, but I can't see the answer!

    I have a listgrid which displays a list of values. I am using smartGWT version 2.2. Here is the code for the list

    Code:
    setAutoFetchData(true);
    setCanEdit(true);
    setDataSource(ProductOptionDataSource.getInstance());
    setUseAllDataSourceFields(true);
    
    setGroupStartOpen(GroupStartOpen.ALL);
    setGroupByField("parentId");
    
    ListGridField productField = new ListGridField("parentId", "Product Code");
    productField.setOptionDataSource(ProductDataSource.getInstance());
    productField.setValueField("id");
    productField.setDisplayField("productCode");
    productField.setAutoFetchDisplayMap(true);
    setFields(productField);
    The grid entries all display fine but the group header on first load of the grid is displaying the id number rather than the productCode which it is set to. setDisplayField("productCode")
    If I enter a new row and click enter, the grid is reloaded with the header correctly showing as the productCode and not the id.
    Can anyone please tell me why I am not getting the productCode displayed initially?

    Regards
    jrich
Working...
X