Furthermore, when I use sortable columns on a grid with selection enabled, the selection get lost as soon as I click on the header, before the “sort” event, so it is even not possible to save the selection before sorting the datasource, in order to restore it at the end.
The selection should be kept when sorting, or for example, there could be some before/after events to save/restore the state manually.
Unfortunately vaadin-grid cannot automatically sort its datasource. The component might be hooked to for example a remote source that it has no control over. As vaadin-grid queries the data (lazily) it’s only aware of the rows in its viewport at a given time. This is why returning a sub-set of correctly sorted source data is the responsibility of the developer.
The second question is kind of related. Selection in vaadin-grid is currently based on row indexes. As you sort the columns, vaadin-grid can’t know what’s the index of a certain row after the sorting is applied so it falls back to clearing the selection instead. You can always maintain a list of the selected items somewhere in store yourself (“select” event indicates a change in selection") and re-apply the selection with new row indexes after sorting.
I am using grid table in my project as well as filter table .I have some problem here that --> in filter table when we clicking on the table header ,first row will be automatically highlighting but coming to grid table ,it is not happening as filter table and also when we click on grid cell it is selecting that cell only but in filter table when we click on any cell it will select entire row ,I want the same action in grid table
I want same behaviour as filter table in grid table how can I achieve it,is there is any possibility to do like that ,any code change or any method i can use .
please give me any solution or any code change to fix this bug .
And iam using the below code in my grid table in my project::