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

Reply
 
Thread Tools Search this Thread
  #1  
Old 7th Jun 2012, 07:43
marlyo marlyo is offline
Registered Developer
 
Join Date: Jun 2012
Posts: 2
Default Order of ListGridFields changed after use of setUseAllDataSourceFields(true)

Greetings,

as said in the title, i have a ListGrid bound to a datasource so i dont need to create all the listGridFields since they are created automatically. so i wanted to add a listGridField on the fly and not create the DataSourceField corresponding in the DataSource, to do that i created the listGridField, then
Code:
 LisGrid.setdfields(new Field)
. the problem i've faced was that the listGrid displayed only the new Field, so to be able to display all other field of the Datasource additionally to the new Field, i called this.listGrid.setUseAllDataSourceFields( true );
the last problem that i couldnt resolve was the displayed order of the columns of the listGrid, i wanted the new field ti be added at last, but it was added in the first column.
i hope i was enough clear.
Reply With Quote
  #2  
Old 7th Jun 2012, 11:24
amcculley amcculley is offline
Registered Developer
 
Join Date: Apr 2011
Posts: 337
Default

Do a getFields() call on the Datasource and then add your custom field to that collection.

Then add them all in order you want to the setFields() call.
Reply With Quote
  #3  
Old 7th Jun 2012, 23:02
marlyo marlyo is offline
Registered Developer
 
Join Date: Jun 2012
Posts: 2
Default

Quote:
Originally Posted by amcculley
Do a getFields() call on the Datasource and then add your custom field to that collection.

Then add them all in order you want to the setFields() call.
thanks for the response,
in first place, i'd used that solution, but realized that the new field was totally foreign to the dataSource, so it's very important for the structure of the application that i don't add that field to the dataSource.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads
Thread Thread Starter Forum Replies Last Post
SelectItem.setValueMap () does not respect LinkedHashMap order for number strings shortpasta Smart GWT Technical Q&A 6 9th May 2014 08:06
How to control order of ListGrid fields when using setUseAllDataSourceFields(true) jay.l.fisher Smart GWT Technical Q&A 1 9th Apr 2012 10:07
isc.screenReader issue acarur01 Technical Q&A 16 1st Mar 2012 04:38
Datasource used for two selectitem with different fetch operations works unexpectedly curiousgally Smart GWT Technical Q&A 2 18th Nov 2011 14:13
Global Changed event handler SBrandon Technical Q&A 2 7th May 2009 07:09

© 2010,2011 Isomorphic Software. All Rights Reserved