# Pivot table - Resizable columns?

cyiannoulis
1191 10

Hi,

Currently we evaluate the pivottable component and i must say we are very impressed! The only thing i would like to ask is if there is any way to make the columns resizable.

Thank you all

delete retag edit

## 10 Replies

jimmyshiau
4921 5
http://www.zkoss.org/

Hi cyiannoulis,
The column size was decide on server side renderer, it cannot be modified in client side.

cyiannoulis
1191 10

Thank you jimmy for your reply. Actually i don't want to resize the columns on the client side but i cannot find which method to call to adjust the width of the columns. Also i would like to know if there is any pricing model for the pivot table module or it is free for the CE users?

Thank you

jeanher
1719 1 6

Hi cyiannoulis,

Pivottable is in its beta and the licensing model is not finalized yet.
It's most likely available under both open source license and commercial license like other components.

jimmyshiau
4921 5
http://www.zkoss.org/

You can define the size by override getColumnSize.

cyiannoulis
1191 10

Thank you very much guys!

jimmyshiau
4921 5
http://www.zkoss.org/

The client column sizing available since ZK Pivottable 2.0.0
http://www.zkoss.org/product/zkpivottable/releasenote/2.0

Bolat
6

Hello, jimmyshiau

How can I resize a column on client side? (zk-pivottable-bin-eval-2.0.0)

jimmyshiau
4921 5
http://www.zkoss.org/

Hi Bolat

The column of Pivottable 2.0.0 are sizeable by default, you can try to hover on the column and use mouse drag to resize.

pijc
15

I know column headers are resizable by default in Pivottable 2.0, but how can you make the columns showing the row headers resizable as well? Using the pivot table example from the release notes, how could you make it so the user can resize the first row header (with "Antonio Mattos", "Becky Schafter", and "Carlene Valone") and second row header (With "Albert..", "Euncie", "Jessica.." and so on) so that they can read the entire contents of those cells?

My first guess was to give the rows div the sizable="true" attribute, but since the Div class doesn't have a setSizable method, that doesn't work.

<pivottable style="border:0px" id="pivot" hflex="1" >
<div />
<div sizable="true">Columns</div>
<div >Rows</div>
</pivottable>


As shown below, I can use the getColumnSize method of a SimplePivotRender child to make the rows for certain fields be a set width. That works when just one field is set to display as a row header, but when multiple fields are set as row headers, the set size gets ignored and the header cell contents get cropped off.

public PivotRenderer getRenderer()
{
return  new SimplePivotRenderer()
{
if(dataField.getType().toString().equals("ROW"))
{
if(dataField.getFieldName().equals("Name"))
return 300;
else
return 100;
}
}
}


I hope there is an easy method or attribute I am missing to allow the row header columns to be re-sized like the standard column headers currently are.

jimmyshiau
4921 5
http://www.zkoss.org/

Hi pijc,

The left row column sizable is not support now, you can post a feature request
http://tracker.zkoss.org/browse/ZKPVT

[hide preview]