Posted 1 November 2019, 8:40 am EST
Hi,
Thanks Ashwin, it works.
The issue with sort that we see is:
We use observable array as datasource for flexsheet which is initialised with 3 custom rows on load. Sort icons from the filter panel is what we use. Sort works fine with these 3 records. But on adding a new row, and then sorting, the newly added rows disappear in the UI. After we insert a new row again, the earlier added rows also appear. Below is the code in place for insert row:
active_sheet.beginUpdate();
active_sheet.itemsSource.beginUpdate();
active_sheet.insertRows(selectedRow, ROWCOUNT);
while (ROWCOUNT > 0) {
newrow = new CustomRecord(vm);
newrow.YEAR = vm.get('ddYearPicker');
newrow.VALIDATION_MESSAGE = DIRTY_RECORD_MARKER;
active_sheet.sheets[0].itemsSource.splice(selectedRow + i - 1, 1, newrow);
ROWCOUNT--;
i++;
}
active_sheet.itemsSource.endUpdate();
active_sheet.endUpdate();
me.formatSheet(active_sheet);
We had also tried the below code provided by your team earlier, which also didn’t work:
active_sheet.insertRows(selectedRow, ROWCOUNT);
while (ROWCOUNT > 0) {
let row = active_sheet.rows[selectedRow + i];
newrow = new CustomRecord(vm);
//newrow.YEAR = vm.get(‘ddYearPicker’);
newrow.VALIDATION_MESSAGE = DIRTY_RECORD_MARKER;
$.extend(row.dataItem, newrow);
ROWCOUNT–;
i++;
}
Please suggest if there’s any other workaround that I can try out.
Thanks,
Keerthana