-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi all,
I need your help about this: as knowing the selected column by clicking in a listbox.
There is a any method getSelectedColumn() ?? or something like?
Thank's a lot..
listbox doesn't have selected column you can only get selected row. If you need selected column you have to have a control (button, image etc..) and let the user click on the control. That will give you an idea on which column they clicked.
Hi, meilynlgg
I write a sample
<zk> <zscript><![CDATA[ void showColumn(Listcell listcell){ Listitem item = listbox.getSelectedItem(); int index = item.getChildren().indexOf(listcell); Listheader listheader = (Listheader)listbox.getListhead().getChildren().get(index); alert(listheader.getLabel()); } ]]></zscript> <listbox id="listbox" width="200px"> <listhead> <listheader label="col1" /> <listheader label="col2" /> </listhead> <listitem> <listcell label="a1" onClick="showColumn(self)"/> <listcell label="a2" onClick="showColumn(self)"/> </listitem> <listitem> <listcell label="b1" onClick="showColumn(self)" /> <listcell label="b2" onClick="showColumn(self)"/> </listitem> </listbox> </zk>
It works on ZK 3.6.X
it will happen NPE on ZK 5.X
because this bug
we will fix it
Asked: 2010-02-19 14:16:38 +0800
Seen: 551 times
Last updated: Feb 22 '10