PDA

View Full Version : populate a grid window using a json tree



vipuljaveri
30 Nov 2010, 3:37 AM
Hi...
I have a window and in the window items i have a json tree....
Now according to what element the user selects in the tree it should open a animated window showing the window grid...now even the grid should populate values according to the element selected from the tree..
what changes do i have 2 do...plz help
This is my code
tree = new Ext.tree.TreePanel({

renderTo : mappingGLform,
height : 403,
width : 335,
useArrows : true,
dragConfig : false,
draggable : false,
autoScroll : true,
enableTabScroll:true,
animate : true,
enableDD : false,
trackMouseOver : true,
containerScroll : true,
rootVisible : false,
frame : true,
hidden : true,
root : {
nodeType : 'async'
},
// auto create TreeLoader
dataUrl : 'json/gl.json',
listeners : {'checkchange' : function(node, checked) {
if (checked) {
// node.getUI().addClass('complete');
} else {
node.getUI().removeClass('complete');
}
}
}

});

tree.filter = new Ext.ux.tree.TreeFilterX(tree);


tree.getRootNode().expand(true);

mapping_UEST = new Ext.Window({
renderTo : document.body,
title : 'Mapping History',
layout : 'fit',
plain : true,
closable : false,
draggable : false,
x : '755px',
y : '53px',
height : 495,
width : '350px',
items : [tree]
});

thanks

Condor
30 Nov 2010, 5:29 AM
Not enough information.

When do you want to show the grid? When a user selects a node, or does he need to press a 'details' button after that or double-click the node or what...

Did you already create the window with the grid?

Where should the grid data come from and how is it related to the selected tree node?

vipuljaveri
30 Nov 2010, 5:38 AM
i want to display a grid window when the user selects a node...
like an on select fn so that a grid inside an animated window will open and display data according to the node selected...

Condor
30 Nov 2010, 5:57 AM
Write a 'click' event handler for the treepanel that opens the window with the grid and loads it according to the clicked node.

vipuljaveri
1 Dec 2010, 4:48 AM
is there any checked like the click event??...
as i want the event to be triggered when the user checks any node of the tree

Condor
1 Dec 2010, 6:32 AM
I don't understand the question...

vipuljaveri
1 Dec 2010, 9:54 AM
actually the click event works when i click on a specific node of the tree but i want a popup window to be displayed when the user selects a particular node(i am using a checkbox tree)...
my code for treePanel is based on the following eg...
http://dev.sencha.com/deploy/dev/examples/tree/check-tree.html
Now if the user selects any node(lets say "take a nap") then a new popup window grid show populate showing values corresponding to the node selected (here "take a nap")...the values are stored in the database...

thanks..