Mark records as new in a ListGrid in SmartGWT

2k Views Asked by At

In SmartGWT, using a ListGrid.

I am currently loading data from a CSV file in order to pre fill a listgrid. I would like to be able to save this data in a database later.

Using listGrid.startEditingNew() I am able to create a record that is considered as new. But it can be very slow, even with a reasonable amount of data (50 rows).

ListGrid listGrid = new ListGrid();

Record record= new Record();
record.setAttribute("attr1", 1);
record.setAttribute("attr2", "2");

listGrid .startEditingNew(record);
listGrid .endEditing();

Here I tried to use a RecordList, so I can update all the data at once. The data is shown fine and fast in the list. But it appears in black font (as if it was fetch). So the rows are not affected by listGrid.saveAllEdits().

I wonder if there is a way to mark each of the records from the RecordList as new rows.

ListGrid listGrid = new ListGrid();
RecordList recList = new RecordList();

Record record= new Record();
record.setAttribute("attr1", 1);
record.setAttribute("attr2", "2");

recList.add(record);
listGrid .setData(recList);
0

There are 0 best solutions below