Announcement

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

  • ListGrid filtering without DataSource

    Hi all!
    I'm using smartGwt [3.0].

    In my application i use only one ListGrid to display statistics data.
    It's stored in mongoDb, so i just forward JSON data to client side.
    As you understand, statistics data may has different structure by types - so i do recursively parse recieved data, get the set of keys and build necessary ListGridFields for ListGrid:

    Code:
    final ListGridField[] fields = new ListGridField[ fieldKeys.size() ];
    for ( String key : fieldKeys ) {
        final ListGridField gridField = new ListGridField( key );
        gridField.setCanFilter( true );
        fields[ i ] = gridField;
        i++;
    }
    setFields( fields );
    It works perfectly, but now i'd like to perform filtering for records, but i cant dynamically change DataSource fields, right?
    DataSource.setFields(...) JavaDoc:
    Code:
    @throws IllegalStateException this property cannot be changed after the underlying component has been created
    Is It possible to perform filtering in ListGrid without attached DataSource?

  • #2
    Simple create a DataSource on the fly from the generated fields.

    Comment

    Working...
    X