Creating sortable columns in a read-only grid seems very straightforward, but I cannot figure out how to do this in an editable grid. I am trying to do this for a numeric decimal column, but would also like the grid to be sortable by multiple columns. Please let me know any suggestions or resources.
Discussion posts and replies are publicly visible
The sorting configuration for editable grid rows is not configured as a parameter from within a!gridLayout() itself. Sort the data outside of the grid component and then loop over the sorted items in the "rows" parameter of the editable grid. For example, if the data you want to sort is coming from a query, use the pagingInfo parameter of the query to sort the data appropriately before it is passed into the grid.
This is possible to do via workarounds like Drew mentions, but there's a reason the editable grid isn't inherently sortable by column - when the data within is actually editable, then trying to change the sort (while pending edits are in place, etc) is just a nightmare. Therefore I strongly recommend against this. If you need sorting, use read-only. If you need editable, then sort the data at the start in a manner that will be suitable until editing is completed.
Hi,
I want to sort the display order column in the editable grid and is this the way it should be done?
How do I know if its working?
a!localVariables( local!QRSuppliers: a!queryEntity( entity: cons!BC_SUPPLIER_DSE, query: a!query( selection: a!querySelection( columns: { a!queryColumn(field: "supplierId"), a!queryColumn(field: "description"), a!queryColumn(field: "displayOrder"), a!queryColumn(field: "createdDate"), a!queryColumn(field: "createdBy"), a!queryColumn(field: "modifiedDate"), a!queryColumn(field: "modifiedBy"), } ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: - 1, sort: a!sortInfo(field: "displayOrder", ascending: true) ) ), fetchTotalCount: true ).data,
Thanks
You should be able to just run that query by itself and verify whether it comes out ordered the way you want.
It's working.
I had the similar question for myself and am glad I came on this one. I hope this solves your question.
ovo game gartic phone