# How to reset column size when they are resizable

WilliamB
1609 1 6

I've a grid with resizable column. Among my columns, I've 2 that are displayed on condition, it's either column A or Column B.

I'm having an issue though. If i launch a search with condition for column A to be displayed. Then resize one column, if i launch a new search which condition for column B, it never shows.

If no resize, it works fine.

So I'm not sure if the issue lies with the visible attribut on those columns, or the hflex. but to be sure I wanted to try and reset the column size to the basic settings.

I've tried invalidating the grid, but I don't see any changes at all, so maybe it's keeping in memory the size of the column?

<columns sizable="true">
<column hflex="2" label="${labels.labla1}"/> <column hflex="3" label="${labels.labla2}"/>
<column hflex="4" label="${labels.labla3}"/> <column hflex="2" label="${labels.labla4}"/>
<column hflex="2" label="${labels.labla5}"/> <column hflex="2" label="${labels.labla6}"/>
<column hflex="3" label="${labels.labla7}"/> <column hflex="5" label="${labels.labla8}"/> visible="@load(vm.mYFlag)" />
<column hflex="2" label="${labels.labla9}"/> <column hflex="5" label="${labels.labla10}"/>
<column hflex="2" label="${labels.labla11}"/> <column hflex="5" label="${labels.labla12}"/> visible="@load(!vm.mYFlag)" />
</columns>


I thought I found it when i stumpled on setInnerWidth in the GRid.java but it does nothing ... The width still at 100% even if it's not true ...

delete retag edit

The fact that the colulmn doesn't re appear is a bug : http://tracker.zkoss.org/browse/ZK-2949

( 2015-11-10 10:03:06 +0800 )edit
Be the first one to answer this question!
[hide preview]