SmartGWT Version: v8.2p_2012-08-06/LGPL Development Only (built 2012-08-06)
IE9 dev mode
I have a ListGrid that is bound to a DataSource and is reusing all DataSource fields. The DataSource is used by multiple components, so we have a need to reorder and rename the fields on the ListGrid. As such, we have made arrays containing all of the field names in their correct order. We then loop through this array, moving and renaming fields like so:
However, there's a single field that refuses to move using this method. It happens to be what should be the first field on the grid. It DOES move if I manually tell it to (after doing the above loop) like this:
But it does NOT move on our first iteration of the above loop for some reason.
My guess is that we are running into some weird race condition where we call reorderField before SmartGWT is done actually moving all of the other fields around.
Any ideas about how to solve this problem would be appreciated.
Thanks,
Brian
IE9 dev mode
I have a ListGrid that is bound to a DataSource and is reusing all DataSource fields. The DataSource is used by multiple components, so we have a need to reorder and rename the fields on the ListGrid. As such, we have made arrays containing all of the field names in their correct order. We then loop through this array, moving and renaming fields like so:
Code:
public void reorderFields() { for (int i = 0; i < FIELD_INDICIES.length; i++) { // Rename each field. setFieldTitle(getFieldNum(FIELD_INDICIES[i]), FIELD_TITLES[i]); // Reorder each field. reorderField(getFieldNum(FIELD_INDICIES[i]), i); } }
Code:
reorderField(getFieldNum(FIELD_INDICIES[0]), 0);
My guess is that we are running into some weird race condition where we call reorderField before SmartGWT is done actually moving all of the other fields around.
Any ideas about how to solve this problem would be appreciated.
Thanks,
Brian
Comment