has anyone figured out how to do table data sorts by header?

Anthony Hall shared this question 7 years ago
Answered

I'm trying to sort data in tables via column headings. Traditionally this is indicated by some sort of symbol associated with a header item or a lin. When the user clicks the heading the table is then sorted to that column.


Anyone doing this or figured out a way to do it?

Comments (7)

photo
1

There is no sort function in the expressions builder yet but you can use the MaxData and MinData functions to simulate a sort but always with fixed values.

photo
1

Sorting is common. Please add this to the expression builder.

photo
1

It's true. The development team has been notified and they added it to the product's roadmap.

photo
1

Victor, could you explain how to use the MaxData and MinData functions to achieve the sort effect?

photo
1

We have created a datagrid sorting example so you can see how it works. It is not very intuitive but at least it will allow you to simulate many sorting cases. The only problem regarding this example is that you must define the number of rows your datagrid will display since we do not have any function to iterate over data master’s instances. In the attached example, the event will order the instances of a Data Master ‘D’ using its attribute ‘num’. Variables ‘tempList’ and ‘orderedList’ are necessary for the calculations. Notice that the result will display only 3 instances but you can increase this number adding iterations in the defined event.


http://justinmind.s3.amazonaws.com/Or...

photo
1

This reply was created from a merged topic originally titled


<a class="notranslate" href="https://www.justinmind.com/community/topic/anyone_know_how_to_sort_a_datagrid_by_the_header/changes"; rel="nofollow" target="_blank">Anyone know how to sort a datagrid by the header?</a>.

photo
1

The sort function was included in the latest releases. http://www.justinmind.com/usernote/te...