Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

setOptionDataSource in ListGrid - strange behaviour

$
0
0
Hi, here is my situation:

[any browser, smartGWT 4.1]

List grid field:
Code:

public ListGridField[] getGridForAdditionFields() {

        FtdViewModel ftdViewModel = new FtdViewModel();
        ListGridField nameField = new ListGridField(FtdDatamodel._id, "FTD");
        nameField.setRequired(true);
        nameField.setOptionDataSource(ftdViewModel.getFtdListDS());
        nameField.setValueField(FtdDatamodel._id);
        nameField.setDisplayField(FtdDatamodel._name);
        nameField.setAutoFetchDisplayMap(true);

        return new ListGridField[]{
              nameField
        };
    }

The grid:
Code:

private ListGrid additionGrid;
    public ListGrid getAdditionGrid() {
        if(additionGrid == null){
            additionGrid = new ListGrid();
            additionGrid.setWidth100();
            additionGrid.setHeight100();
            additionGrid.setCanEdit(true);
            additionGrid.setShowHeader(false);
        }
        return additionGrid;
    }

DataSource has id field and name field and it is NOT ClientSide

The PROBLEM:
when I try to edit the grid with one column (id) I can see the "names" of the records - and this behaviour is good !
BUT when I actually add record to grid I see the id's instead of the names, what did I miss ?

I want to see names instead of id's. Why this column did not accept value map ?

Viewing all articles
Browse latest Browse all 4756

Trending Articles