Provide Control UI"

From Documentation
Line 47: Line 47:
 
 
 
}
 
}
 +
}
 
</source>
 
</source>
  
Line 53: Line 54:
  
 
&nbsp;
 
&nbsp;
 +
 
==Customize PivotFieldControl==
 
==Customize PivotFieldControl==
  

Revision as of 09:50, 21 November 2011


You can change page, open/close node, or resize columns on the Pivottable component itself. However, for UI flexibility, the component itself does not provide control unit for other APIs, like to change pivot fields, toggle data field orientation, or sort the headers.

Simple controls

The following properties on Pivottable are very straightforward to wire up:

  • data field orientation
  • whether to show row/column grand totals

For example,

<pivottable id="pivot" />
<checkbox label="Enable grand total for columns" onCheck='pivot.setGrandTotalForColumns(self.isChecked())' />
<checkbox label="Enable grand total for rows" onCheck='pivot.setGrandTotalForRows(self.isChecked())' />
<radiogroup id="dataOrient">
	Data field orientation:
	<radio id="colOrient" label="column" onCheck='pivot.setDataFieldOrient("column")' />
	<radio id="rowOrient" label="row" onCheck='pivot.setDataFieldOrient("row")' />
</radiogroup>


 

Use PivotFieldControl to handle field setting

Compared to the others, field setting UI is much trickier to compose. Thus we have provided a macro component to simply the work.

ZUL:

<pivottable id="pivot" />
<pivot-field-control id="pfc" height="300px" /><!-- Remember to specify height -->

Composer:

public class PivotController extends GenericForwardComposer {
	private Pivottable pivot;
	private TabularPivotModel _model;
	private PivotFieldControl pfc;
	
	public void doAfterCompose(Component comp) throws Exception {
		super.doAfterCompose(comp);
		
		_model = MyPivotModelFactory.getModel(); // construct your pivot model
		pivot.setModel(_model);
		pfc.setModel(_model);
		
	}
}

TODO: img


 

Customize PivotFieldControl

TODO: layout, labels

Version History

Last Update : 2011/11/21


Version Date Content
     



Last Update : 2011/11/21

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.