It’s possible that when adding a new record in a dataGrid and it occupies the available screen, do not add it at the end, but do it in the first record of the grid.
Hi,
Sure, it’s possible. To do so, you need to cast your datasource to CollectionDatasource.Ordered
, for instance:
@Inject
private CollectionDatasource.Ordered<Customer, UUID> customersDs;
and use the addItemFirst
method:
Customer customer = metadata.create(Customer.class);
customersDs.addItemFirst(customer);
customersDataGrid.edit(customer);
Regards,
Gleb