Go Back   SmartClient Forums > Smart GWT Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Thread Tools Search this Thread
Old 5th May 2012, 01:31
kester kester is offline
Registered Developer
Join Date: May 2012
Posts: 1
Default 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:

final ListGridField[] fields = new ListGridField[ fieldKeys.size() ];
for ( String key : fieldKeys ) {
    final ListGridField gridField = new ListGridField( key );
    gridField.setCanFilter( true );
    fields[ i ] = gridField;
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:
@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?
Reply With Quote
Old 5th May 2012, 09:24
Isomorphic Isomorphic is offline
Join Date: May 2006
Posts: 41,424

Simple create a DataSource on the fly from the generated fields.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
JPADataSource - transaction problem when using queueing dejan Smart GWT Technical Q&A 7 13th Feb 2012 13:22
JPADataSource and ManyToMany relationship dejan Smart GWT Technical Q&A 8 9th Feb 2012 08:27
Filter on foreign table valbosoft Smart GWT Technical Q&A 22 4th Jan 2012 12:50
Filtering a ListGrid with no DataSource dead_passive Smart GWT Technical Q&A 0 1st Dec 2010 09:14
Datasource and ListGrid filtering cuthbertb Smart GWT Technical Q&A 0 3rd Jul 2010 08:49

© 2008 and beyond Isomorphic Software. All Rights Reserved