You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also it is not clear why the filter function accepts so many parameters. Usually only the cell value and the search string should be used to determine the result. The example in the documentation uses rowData to access a field in the data that is not even displayed in the table to apply the filter. This is not realistic in my opinion - no user would ever expect a filter to work like that.
But I can see that there may be a use case where the exact filter implementation may depend on some information about the row - but certainly not about the other rows, so I don't thing the allData is required here.
So the signatures in this example should be:
export type ColumnValuePrepareFunction = (cell: Cell) => string;
export type ColumnFilterFunction = (cell: Cell, searchString: string) => boolean;
We may find more examples of signatures that should be corrected. But this is the most prominent one, I think.
The text was updated successfully, but these errors were encountered:
The cell already allows accessing the row, so it's unnecessary to provide both as arguments
The cell uses the valuePrepareFunction. On the other hand, we cannot just remove the cell from the signature, because that definitely breaks backwards compatibility in a very unpleasant manner.
As a compromise, we will define the signatures as follows:
Filters apparently do not work on row/cell and instead on the data source, only. Yet another mix-up of responsibilities between table/grid and data source. So the most clean, yet possible signature is:
The functions that can be specified to control the smart table depending on the row data, all accept the data as input.
Examples:
Also it is not clear why the filter function accepts so many parameters. Usually only the cell value and the search string should be used to determine the result. The example in the documentation uses
rowData
to access a field in the data that is not even displayed in the table to apply the filter. This is not realistic in my opinion - no user would ever expect a filter to work like that.But I can see that there may be a use case where the exact filter implementation may depend on some information about the row - but certainly not about the other rows, so I don't thing the
allData
is required here.So the signatures in this example should be:
We may find more examples of signatures that should be corrected. But this is the most prominent one, I think.
The text was updated successfully, but these errors were encountered: