Page 1 of 1

Event handler passing through to default behaviour

Posted: Wed May 05, 2021 11:03 pm
by davec
I would like to be able to use the TitleClick notification in a listview, but would also like its default behaviour to still work (ie, on a sortable column still be able to toggle between ascending and descending sort and execute the sort).

However, if I listen to that notification and have some custom code for it in the event handler, it overrides the default behaviour and only my code is executed.

Is there a way to still listen to the notification and do something while continuing to use the default behaviour?

Thanks
Dave

Re: Event handler passing through to default behaviour

Posted: Thu May 06, 2021 12:54 am
by amyren
I had a smilar experience (in the other sorting thread). It looks like TitleClick does not go well with setting columns sortable.
Hopefully this will work better with the awaited RapaGUI 2.0.

Re: Event handler passing through to default behaviour

Posted: Thu May 06, 2021 2:47 am
by davec
As did I (ie, that sorting thread), that's why I started this one :)

amyren wrote: Thu May 06, 2021 12:54 am I had a smilar experience (in the other sorting thread). It looks like TitleClick does not go well with setting columns sortable.
Hopefully this will work better with the awaited RapaGUI 2.0.

Re: Event handler passing through to default behaviour

Posted: Thu May 06, 2021 9:50 am
by amyren
I did try to create a workaround by switching on/off the TitleClick notification.
But even just having this one line in the script will kill the sorting

Code: Select all

moai.Notify("lv", "TitleClick", False)
As an alternative I now use ClickColumn instead of TitleClick, and at least sort any column using that approach.