Hi,
i'am using a ListGrid with client use only. Adding of Records works well but i don't get "removing of all records" implemented.
Here the definition of the ListGrid and DataSource
That is the method which adds records to ListGrid, this works well and with out problems...
And that is the method which should remove all records from the ListGrid, that works completly not ;) and is my problem
Knows some one what is wrong? Or what i have to do diffrent to get it to work?
Thanks for help :)
i'am using a ListGrid with client use only. Adding of Records works well but i don't get "removing of all records" implemented.
Here the definition of the ListGrid and DataSource
Code:
//ListGrid stuff ListGrid listGridLayout = new ListGrid(); ListGridField fieldName = new ListGridField("name", "Name"); ListGridField fieldUrl = new ListGridField("url", "Url"); ListGridField fieldMultiContent = new ListGridField("multicontent", "Multi content"); ListGridField fieldMultiTitle = new ListGridField("multititle", "Multi title"); DataSource listGridLayoutDataSource = new DataSource(); DataSourceTextField nameDataSource = new DataSourceTextField("name"); DataSourceTextField urlDataSource = new DataSourceTextField("url"); DataSourceTextField multiContentDataSource = new DataSourceTextField("multicontent"); DataSourceTextField multiTitleDataSource = new DataSourceTextField("multititle"); listGridLayout.setShowAllRecords(true); listGridLayout.setAutoFetchData(true); listGridLayout.setFields(fieldName, fieldUrl, fieldMultiContent, fieldMultiTitle); listGridLayoutDataSource.setClientOnly(true); listGridLayoutDataSource.setID("LayoutGrid"); listGridLayoutDataSource.setFields(nameDataSource, urlDataSource, multiContentDataSource, multiTitleDataSource); listGridLayout.setDataSource(listGridLayoutDataSource);
Code:
public void addRecordsToTreeGrid(ListGridRecord records[]) { for (int i = 0; i < records.length; i++) { listGridLayoutDataSource.addData(records[i]); } }
Code:
public void clearRecordList() { ListGridRecord[] tst = listGridLayout.getRecords(); for(int i = 0; i < tst.length; i++) { listGridLayoutDataSource.removeData(tst[i]); listGridLayout.refreshRow(i); } }
Thanks for help :)
Comment