Hello,
I have a case where I need to insert a items to the beginning of a datatable (imagine a case where the user choose a role from a autocomplete and add it to List, that will appear in a datatable).
My doubt is, how can I make the last item added appear on top of the datatable?
I see some scenarios but I'm curious to know if there is a better approach:
1. Use list.add(0, myObject);
or
2. Create a wrapper object that has a field called insertedDateTime then use the sortBy param from dataTable.
Any suggestion?
Datatable insertion order
-
- Information
-
Who is online
Users browsing this forum: No registered users and 72 guests