If you allow users to resize the widths of columns, you can specify true to the sizable property of columns as follows. Once allowed, users can resize the widths of columns by dragging the border between adjacent column components.
<window> <grid> <columns id="cs" sizable="true"> <column label="AA"/> <column label="BB"/> <column label="CC"/> </columns> <rows> <row> <label value="AA01"/> <label value="BB01"/> <label value="CC01"/> </row> <row> <label value="AA01"/> <label value="BB01"/> <label value="CC01"/> </row> <row> <label value="AA01"/> <label value="BB01"/> <label value="CC01"/> </row> </rows> </grid> <checkbox label="sizeable" checked="true" onCheck="cs.sizeable = self.checked"/> </window>
Once a user resizes the widths, the onColSize event is sent with an instance of org.zkoss.zul.event.ColSizeEvent. Notice that the column's width is adjusted before the onColSize event is sent. In other word, the event serves as a notification that you can ignore. Of course, you can do whatever you want in the event listener.