Page 1 of 1

Tables with a listbox selection style

Posted: Fri Aug 07, 2009 12:20 pm
by ConvertFromOldNGs
by pillick >> Tue, 4 Feb 2003 1:15:30 GMT

Hi.

I have a table, where each row is an item and each column is an attribute of the item.

I want users to be able to select multiple items (rows) in exactly the same way as they would select items in a listbox with extended multi-selection (ie shift selecting a range, and ctrl adding to the selection)

Any idea how I would go about this? is there a way to determine weither the ctrl or shift keys are pressed from within the table_click event?

Thanks in advance
Dave

Re: Tables with a listbox selection style

Posted: Fri Aug 07, 2009 12:20 pm
by ConvertFromOldNGs
by allistar >> Tue, 4 Feb 2003 5:34:14 GMT

Hi Dave,
It is possible to do this (we do exactly this in our product). It's a shame there isn't a parameter in Jade that allows this to be done automatically.

Rather than doing it on the table.click event code it onto the table.mouseDown event. From there you can tell if cntrl or shift is held down. Your logic needs to remember what the first row clicked on was (so that you can adequately select mutliple rows when the "shift" button is held down.

What we do is store a collection of currently selected rows (or in our case the objects in the rows) which prevents you form needing to keep asking the table whether a row is currently selected or not, and it simplifies selection somewhat.

Hope this helps,
Allistar.

------------------------------------------------------------------
Allistar Melville
Software Developer, Analyst allistar@silvermoon.co.nz
Auckland, NEW ZEALAND

Silvermoon Software
Specialising in JADE development and consulting
Visit us at: http://www.silvermoon.co.nz ------------------------------------------------------------------

Re: Tables with a listbox selection style

Posted: Fri Aug 07, 2009 12:20 pm
by ConvertFromOldNGs
by cnwjadesupport >> Tue, 4 Feb 2003 22:10:11 GMT
It is possible to do this (we do exactly this in our product). It's a shame there isn't a parameter in Jade that allows this to be done automatically.

Allistar,

I opened an NFS for this very feature (NFS#27236) and it has been included in the 6.0 release - closure details for NFS are as follows:

"Table.selectMode now has an additional type SelectMode_WholeRows(9) which allows the selection of of multiple rows automatically."

Thanks,
Brian Johnstone,
JADE Support.

Re: Tables with a listbox selection style

Posted: Fri Aug 07, 2009 12:20 pm
by ConvertFromOldNGs
by pillick >> Wed, 5 Feb 2003 3:40:53 GMT

nice, I figure it was something people would want to do quite often. Is there a patch to update jade to version 6.0 available?

Re: Tables with a listbox selection style

Posted: Fri Aug 07, 2009 12:20 pm
by ConvertFromOldNGs
by cnwjadesupport >> Wed, 5 Feb 2003 22:25:55 GMT
nice, I figure it was something people would want to do quite often. Is there a patch to update jade to version 6.0 available?

JADE 6.0 is due for release later this year.

Thanks,
Brian Johnstone,
JADE Support.