Announcement

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

    How to add changed handler to grid?

    I have some trouble.
    My grid generates from datasource (XJSONDataSource)
    Code:
    TaskDS taskDS = TaskDS.getInstance();
    grid.setDataSource(taskDS);
    And I'd like to have depended selectboxes in it. I'm reading showcase examples and write my code.
    So, I read http://www.smartclient.com/smartgwt/...t_selects_grid
    and I was trying:
    Code:
    ListGridField[] fields = grid.getFields(); // for test
    ListGridField departmentField = grid.getField("department");
    department.addChangedHandler(new ChangedHandler() {
        @Override
        public void onChanged(ChangedEvent event) {
            grid.clearEditValue(event.getRowNum(), "assignedTo");
        }
    });
    A part of code from TaskDS:
    Code:
    DataSourceField assigneddepartment = new DataSourceField("department", FieldType.TEXT, "Department");
    But departmentField and even fields is always null.

    Where is my mistake?
Working...
X