|
#1
|
|||
|
|||
|
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 );
DataSource.setFields(...) JavaDoc: Code:
@throws IllegalStateException this property cannot be changed after the underlying component has been created |
|
#2
|
|||
|
|||
|
Simple create a DataSource on the fly from the generated fields.
|
![]() |
| Thread Tools | Search this Thread |
|
|
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 |