Announcement

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

    Error When Filtering Grid

    I am getting an error when attempting to filter a grid when setting data to a ListGridRecord array. Please see below:

    Code:
    ListGrid listGrid = new ListGrid();
    listGrid.setHeight(318);
    listGrid.setWidth(750);
    listGrid.setShowFilterEditor(true);
    listGrid.setFilterOnKeypress(true); 
    
    ListGridField foo1= new ListGridField("foo1", "foo 1");
    ListGridField foo2= new ListGridField("foo2", "foo 2");
    
    listGrid.setFields(new ListGridField[] {foo1, foo2});
    
    ListGridRecord[] gridData = new ListGridRecord[foos.size()];
    for (int i = 0; i < foos.size(); i++) {
    gridData[i] = new ListGridRecord();
    gridData[i].setAttribute("foo1", foos.get(i).getFoo1());
    gridData[i].setAttribute("foo2", foos.get(i).getFoo2());
    }
    listGrid.setData(gridData);
    Error message:
    No DataSource or invalid DataSource specified, can't create data model
    Last edited by jvincent; 19 Jul 2011, 08:37.

    #2
    Try doing this for the setField method.

    listGrid.setFields(contractNumberField,contractPlanNumberField );

    Comment

    Working...
    X