-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi All,
I'd like to apply attribute "unseletable" which is an HTML element property (e.g. <span unseletable="on">) to ZK element "listbox". I tried to mix html tag into .zul by using <h:div unseletable="on"> around the listbox, but it doesn't work. It only works around pure text.
The attribute "unseletable" is used in IE to turn off the selection of the text in browser. My goal is to turn off the selection of text in my listbox. If anyone has experience in applying html attributes to ZK elements, I would really appreciate if you could give me some advice.
Thanks in advance!
Hi
here is a workaround
<?page title="new page title" contentType="text/html;charset=UTF-8"?> <zk xmlns:w="client"> <style> .z-listcell-cnt { -moz-user-select: none; -webkit-user-select: none; } </style> <listbox> <attribute w:name="onBind"> var chd = jq(this.$n()).find('.z-listcell-cnt').each(function (index, node) { jq(node).attr('unselectable', 'on'); //for IE }); </attribute> <listhead> <listheader label="header" sort="auto" /> </listhead> <listitem> <listcell label="Cell 1"/> </listitem> <listitem> <listcell label="Cell 2" /> </listitem> </listbox> </zk>
Asked: 2010-10-11 10:06:04 +0800
Seen: 446 times
Last updated: Oct 18 '10