Is there a way to modify a Text List (and/or Matrix) header?
When the user clicks on the a header, it will sort the table based on the column clicked.
I’d like to add some kind of up arrow (^) and down arrow (v) to indicate which whether it’s sorted “up” or “down” … preferably, it would be indicated with a Font Awesome character/icon.
It can be done by creating Text Display objects that appear to be a part of the list or matrix instead of using a header line within them. Then it’s a matter of changing and redisplaying a variable. The user will never see the difference unless you need resizable columns.
Sorry, this showed up in my email last week and I hit reply there, forgetting that email replies to these posts go into the ozone or somewhere…
I’m referring to placing Text Display objects above the top of a matrix or text list as substitutes for using a header line within either. It does everything the header line can do, except column resizing, and provides a number of visual and programming options the built-in header cannot. (Undoubtedly, Gary will point out that it can be programmed to resize columns too)
A Text Display can be programmed to perform like a button or a popup menu. But a transparent PopupButtonObject laid over them is easier if you want to add a lot of options. Depending on the number of choices you might want to add, with a line of them across the top of a matrix or text list, serving as substitute headers, you can do all sorts of things with them.
Sorting is probably the most obvious. As a button a Text Display can be set to sort on way normally, but the other way with a modifier key pressed. ArrayMultiSort is marvelous for use on a matrix.
Or a PopupButtonObject can have the choice of Sort Up or Sort Down. The menu can have added options such as triggering a selection of data related to the highlighted line in the matrix or text list.
I’ve used a popup menu to control outline levels in a matrix. The matrix starts out showing only the Level 1 records, but with a line highlighted, a menu can trigger an array filter to display the Data Level records that are associated with the highlighted line - or hide them again.
I guess it would be possible to kludge together something that would allow for changing the column widths on the fly using a SliderButtonObject or a ScrollerButtonObject to change the value of the “$TextListColumns” item of the Text List. You would then need to move the column line width indicator in the false header and adjust the text to match the new setting. This could get very, very complicated and probably not worth the effort. I’ll pass on this one.