PDA

View Full Version : Multi Selection of nodes on a tree Panel to populate a grid



sachintaware
18 May 2012, 10:55 AM
Hello
I have been working on a application using spring mvc-extjs4.
I have a tree panel and a grid populating based on the tree panel.Now I want to implement a multisection on the tree panel,i.e if we select multiple tree nodes,subsequent records should be visible in the grid.

Ex:
If I have Manchester United as a tree node and the grid displays its players.If I select a second team say Rel Madrid it should display,players of both teams.
Two possibilities I thought about:
1) Using a ctrl button(Normal multiselect option on keypress)
2) Using checkbox.(Adding checkbox to tree panel(not sure if doable,maybe a treegrid needed) and on checking each box of subsequent node values to be displayed in the grid.)

I would like to know what is possible to implement and easy way to go about it.

My tree and grid panel current function to select a node and populate grid is as follows.



treePan.getSelectionModel().on('select', function(selectionModel,record,index,options) {
var getid = record.getId('id');
console.log(getid);
store_company.load({
params: {
// start:0,
getid:getid
// limit:itemsPerPage
}
});

});


Any suggestions/inputs appreciated.
Thanks for the time.

vietits
18 May 2012, 6:03 PM
What you should do is:
1. Config your tree with multiSelect set to true.
2. Listen for 'selectionchange' event on your tree and proceed from there.