0

I am using gwt celltable.

My columns are configurable through other module. used AsyncDataProvider to update row data.

Is there any way in celltable to updateColumnData only? so that newly added data get inserted into celltable or to remove column from celltable.

Assume, 10 column in table. User can configure celltable column

  • user want to remove 2 selected column then server call is made and related recordList object along with columninfo (8 columns) is coming, but in this case old 10 columns with data and 8 column without data is populated into celltable

Actual: 18 columns displaying in celltable, 10 column with data + 8 column without data

Expected: 8 column with record

Sample code is as follows

 asyncDataProvider.updateRowData(startRowIndexOfPage, result);
                   if ("CONFIGURE".equals(eventType)) {
                        cellTable.redraw();
                       // To create column 
                        createCellTableColumns(latestColumnList); 
                    }
 cellTable.redraw();

result : record list with record information latestColumnList : List : Updated number of column with column information

I want to show only new data(column+record data) in celltable which comes from server

Edit Tried to create new celltable with new column data in following way but not useful new column not added/removeed old celltable is as it is.

  if ("CONFIGURE".equals(eventType) ) {
       asyncDataProvider.removeDataDisplay(cellTable); // remove old celltable
       cellTable = createNewCellTable(); // after column config create new celltable
       pager.setDisplay(cellTable); 

       pager.setSearchRecordCount(searchRecordCount);
       asyncDataProvider.updateRowData(startRowIndexOfPage, result);
                        createCellTableColumns(latestColumnList());  
    asyncDataProvider.addDataDisplay(cellTable);
                   }

How to do this?

StackOverFlow
  • 4,486
  • 12
  • 52
  • 87
  • Don't mess up. My better way is to create a new cell table again. – Suresh Atta Apr 26 '13 at 07:03
  • @Baadshah Thanks for replay. I will create new celltable and linked to my asyncDataProvider & pager [#1] ]asyncDataProvider.addDataDisplay(cellTable); [#2]pager.setDisplay(cellTable); Is that ok? Or anything extra I need to do ? – StackOverFlow Apr 26 '13 at 08:06
  • seems ok.And isuggest you to go through the link for more clarity on this. http://stackoverflow.com/questions/3772480/remove-all-columns-from-a-celltable – Suresh Atta Apr 26 '13 at 08:24
  • @Baadshah I tried to create new celltable for this problem but no effect. see edited part of question – StackOverFlow Apr 26 '13 at 10:59

0 Answers0