Customization Points
Class Diagram
Customization points for JcaTreeConfig
The following table depicts the customization points available using TreeConfig APIs.
Property setting API
Description
setExpansionLevel
Set the the initial expansion level of the tree.
setNodeColumn
Set the name of the column that will be used to display node labels.
setShowTreeLines
Set whether tree lines will be displayed to show structure in the tree
setDisableAction
If set to true, will not show the expand/collapse norgie in the tree
JcatTableConfig provides an API setFindInTableMode. This API can be used for tree to enable/disable findInTree functionality.
Configuring Tree – Defining Node Column
The id of the column that you want to display node labels (or +/- norgie) should be passed to setNodeColumn method
In buildcomponentCOnfig method, builder should call this setter method on TreeConfig
Example:
TreeConfig tree = factory.newTreeConfig();
tree.addComponent(factory.newColumnConfig(NAME, true));
tree.addComponent(factory.newColumnConfig(NUMBER, true));
tree.setNodeColumn(NUMBER);
Configuring Tree — Control Level of Expansion
When the Tree is populated and presented for the first time, you can control the level to which it’s expanded. It can be done by one of the following expansion level using setExpansionLevel
If the expansion value is “none”, it will be expanded until root level. For a value of “one”, it will expand until I level and for a value of “full”, you get a fully expanded tree.
Example:
TreeConfig tree = factory.newTreeConfig();
treeConfig. setExpansionLevel (TableTreeProperties.FULL_EXPAND);
Configuring Tree – Hide Expand/Collapse Norgie
Expand/collapse norgie presentation is controlled by setDisableAction method. You can set string value for this attribute. “true” value will present the expand/collapse norgie whereas “false” value will hide them.
TreeConfig tree = factory.newTreeConfig();
treeConfig. setDisableAction(“false”) //hides the expand/collapse Norgie
Configuring Tree — Enable Tree Lines
You can show tree lines to display the structure in the tree by using calling setShowTreeLines method as following:
TreeConfig tree = factory.newTreeConfig();
treeConfig. setshowTreeLines (false);
Configuring Tree — Pre Selection of Rows
To configure pre selection of rows in tree, register a function when component is available.
The function name can be anything but it should be in global namespace.
PTC.onAvailable(‘<component_id>’,populateConfig);
In the registered function provide implementation of populatePreSelectionsConfig function which is defined at grid object.
function populateConfig(grid){
grid.populatePreSelectionsConfig = function(preSelecionObj){
preSelecionObj.comparableFn = "PTC.carambola.compareOid";
var defaultValues = ['LEG','BOLT_1_4','TIRE'];
preSelecionObj.oids = defaultValues;
}
}
Infrastructure calls populatePreSelectionsConfig function for each grid at runtime so populatePreSelectionsConfig function name can’t be changed.
In populatePreSelectionsConfig function specify values array which needs to be preselected and comparator function in the preSelecionObj argument.
Comparator function is needed to ascertain whether JCA oid’s representation is same as specified in preSelectionObj.oids to preselect a row.
For e.g. in type picker, oid specified will be in the format wt.doc.WTDocument while the JCA representation is typepicker$typePicker$$|components$loadWizardStep$$wt.doc.WTDocument!* so a comparator function would check whether wt.doc.WTDocument is same as typepicker$typePicker$$|components$loadWizardStep$$wt.doc.WTDocument!*
Было ли это полезно?