Basic Customization > User Interface Customization > Presenting Information in the UI > Windchill Client Architecture Tree > Customization Points > Configuring Tree — Pre Selection of Rows
  
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!*