-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I am using ZK 5.0.4 upgrading from ZK 3.6.
I think the behavior of right click on the listitem is not working as before.
In ZK 5, when I have selected multi-items and right click on one of the item, it deselects all other selected items except the one right clicked.
Previous version, it did not deselect any item.
Even the behaviors of live demo and sandbox demo are different.
http://www.zkoss.org/zkdemo/listbox/multiple_selection
http://www.zkoss.org/zksandbox/userguide/#g9
Does anyone have any idea?
Thanks
Hi
I tried ZK 5, it didn't deselects all other selected items, it only deselects itself
Which browser do you ues ? I tested on FF36
Hi,
I used FF 3.6, too.
You can try this demo link.
http://www.zkoss.org/zksandbox/userguide/#g9
You select a few items and use right click on one of them.
Then only the right click one remaining. (If you right-click right on the check mark seems works as you mentioned.)
But somehow this demo link
http://www.zkoss.org/zkdemo/listbox/multiple_selection does not deselect other items.
Thanks
Hi,
I read release note about it
For listbox and tree, if checkmark is enabled, clicking an item will toggle
the selection rather than deselect all others.
If you want to deselect all others (as 5.0.4 or ealier did), please
specify true to library properties called
org.zkoss.zul.listbox.checkmarkDeselectOthers
and org.zkoss.zul.tree.checkmarkDeselectOthers
please refer to Library Properties
Hi,
Thanks for your reply.
Looks like the release note you mentioned is 5.0.5 right?
So there is no other choices in v5.0.4?
Actually, in zk 3.6, right click was working better.
In 3.6, when I select multi-items and use right click to do some actions using menu popup, all the selected items stay the same.
I think that is the correct behavior for right click action. (for example, you select multiple files and try to copy them with right click, you don't want any file to be deselected.
Somehow, now in 5.0.4, right click action is treated almost same as left click action on multi select list.
I appreciate you taking some time to answer my question.
Hi
I think you are right, right click should not change select status, I post a feature request here
in zk 5.0.4, you can achieve by override javascript function
<?page title="new page title" contentType="text/html;charset=UTF-8"?> <zk> <script><![CDATA[ zk.afterLoad('zul.sel', function(){ zul.sel.Listbox.prototype.shallIgnoreSelect_ = function (evt) { return evt.name == 'onRightClick'; }; }); ]]></script> <menupopup id="mmPP"> <menuitem label="item 1" /> <menuitem label="item 2" /> </menupopup> <listbox checkmark="true" multiple="true"> <listhead> <listheader label="header" sort="auto" /> </listhead> <listitem context="mmPP"> <listcell label="cell 1" /> </listitem> <listitem context="mmPP"> <listcell label="cell 2" /> </listitem> <listitem context="mmPP"> <listcell label="cell 3" /> </listitem> <listitem context="mmPP"> <listcell label="cell 4" /> </listitem> </listbox> </zk>
Asked: 2010-10-08 18:41:16 +0800
Seen: 1,067 times
Last updated: Oct 21 '10