Hello, i´m having an issue sorting a grid column,
This column, has data tye of date and time, and I'm trying to make the info descending, (showing the most recent one at the top)
Here is the code line:
a!gridTextColumn( label: "Fecha Ingreso", field:"fecha_ini", data: text(local!dataPuesto.data.fecha_ini, "dd/MM/YYYY") ),
value: a!pagingInfo(startIndex: 1, batchSize: 10, sort: a!sortInfo(field:"fecha_ini", ascending: true), validations: {}, shadeAlternateRows: true
I converted the data to text because it shows values i dont require, but i also tried with this data type.
Discussion posts and replies are publicly visible
Make the paging info a local variable that the grid saves into
load( local!pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 10, sort: a!sortInfo(field:"fecha_ini", ascending: false), with( local!dataPuesto: todatasubset(ri!dataPuesto, local!pagingInfo), { a!gridField( columns: { a!gridTextColumn( label: "Date & Time", field: "fecha_ini", data: index(local!dataPuesto.data, "fecha_ini", null) ) }, value: local!pagingInfo, saveInto: local!pagingInfo ) } ) )
But its not working in my case. As per my problem i have passed local!pagingInfo to with()->Another rule with dataset.
Try sorting the info in the query, before you using it in the grid.
Please post your code and maybe some more detailed explanation of what your current setup is, otherwise anyone who tries to help will be just guessing blind.