mIRC Homepage
Posted By: MTec007 MDX, views.mdx sort listview - 11/12/08 03:53 PM
I am trying to figure out how to sort the listview by column headers, where it will list a-z,0-999+ when clicked but when clicked twice, it will list z-a,999+-0. I have several headers which i am trying to add this support for, and I'm not sure where to start, I have never attempted this before. all help is great. thanks.
Posted By: MTec007 Re: MDX, views.mdx sort listview - 15/12/08 11:25 PM
does any body know how to do this?
Posted By: argv0 Re: MDX, views.mdx sort listview - 16/12/08 12:06 AM
I feel like if it was a supported feature of MDX it would be documented in MDX's documentation. Have you checked for it?
Posted By: Mpdreamz Re: MDX, views.mdx sort listview - 16/12/08 12:13 AM
MDX does send a "headerclick" event.
By checking the "headerevent" page you can get the column number that was clicked on
Quote:

headerevent <col#>

Indicates the column most recently affected by an event triggered by the user.


which you can get by querying item 1 in the listviews did.

if you mirror the listviews content in a hidden @window you could then use /filter to sort based on the clicked column taking advantage of /filter's column sorting. Then issue a savebuf/loadbuf to the listview based on the window or even a filter directly. I know for sure loadbuf works with MDX not sure about /filter.
Posted By: DJ_Sol Re: MDX, views.mdx sort listview - 19/12/08 01:55 PM
Yeah the issue you are having is thinking that it has all the commands you need when in reality you have to actually write them.

There are a few ways to alphabetize a list. I thought you could use the "sort" parameter for the listbox in the dialog event. If you want to switch back and forth you will have to take note when they click on the header as MPDreamz told you, then sort the list how you want it.

You would also need to provide the graphic if you want to have that arrow point up or down on the header like in MS applications. Then again, I dont think y ou can put an image on the header. If you can't, you can create your own sort button.
© mIRC Discussion Forums