There is a requirement wherein the user wants that the Nattable be default sorted as per a specific column & in a particular direction. The nattable is expected to contain around 300 rows. The current implementation contains IColumnPropertyAccessor which will give the rows & the cell values at runtime. The column as well as the direction can have any value & after the default sort, sorting must be possible on other columns as well. We are using ISortModel for the initial sort as below (this is once the nattablle is configuered)
nattable.configure();
getsortHeaderLayer().getSortModel().sort(0, SortDirectionEnum.ASC, false);
Please suggest any other way out if any to reduce the sorting time & make the nattable more efficient.
Note :- The table is expected to have on an average 300 rows. Do let me know if more information is required.
If you use GlazedLists, there is no better performance gain I would know for initial sorting inside NatTable. That should be already good enough. Whether you use the SortColumnCommand
or directly operate on the SortModel
is a design decision. I typically recommend to use the command, as it hides the implementation/configuration details. The default command handler uses the ISortModel
, so in the end the same code is executed.