Hi,
Global Exception Handling with ASP.NET:: You cant debug a problem if you dont know that it exists. The code in these listings defines a web form with a text box and a button. http://www.developer.com/net/asp/article.php/961301HOME |
I have a tricky puzzle.
The following is in my application:
1) a Treepanel
2) a button in another panel which opens a modal window containing a form.
On form submit, I need the node.id of the tree element currently selected. For some reason, I can't find a reference to it. I tried the usually sucessfull Ext.getCmp with no luck. Referencing the tree directly by name doesn't work either.
Here are two relevant snippets of code. Please notice that in the formWindow the handler for the button contains the variable "fid". This where I am unsuccessfully attempting to get the selected node. Percheron, clydesdale, belgian, shires for sale:: Percheron, clydesdale, belgian, shires for sale, Bee Tree Trail horse drawn transportation sleigh ride and carriage ride Berks County weddings Pa. business. lehigh http://www.beetreetrail.com/horses4sale.htmlHOME | World of Warcraft - English (NA) Forums -> Beta + Druid Form Shifting :: and it completely sucks having to hit the button for the form you and as a bonus I have a seperate bar for either moonkin or tree of life form. http://forums.worldofwarcraft.com/thread.html?topicId=35805346&pageNo=1&sid=1HOME |
For creating the tree
//In the MAIN code block
var folderTree = new buildFolderTree();
//Elsewhere functions are defined...
function buildFolderTree(){
// Define the loader for the folder list
var folderLoader = new Ext.tree.TreeLoader({
url: 'getfolder.php',
});
var folderPanel = new Ext.tree.TreePanel({
region: 'west',
title: 'Folders',
hlColor: 'FFFF66',
autoScroll:true,
animate:true,
enableDD:true,
enableDrop: true,
ddGroup: "folderDD",
margins:'0 0 5 0',
containerScroll: true,
rootVisible: false,
split: true,
loader: folderLoader,
width: 125,
minSize: 74,
maxSize: 300,
tools: folderTools
});
folderPanel.setRootNode(root);
// Return the panel object
return folderPanel;
Then in another panel, I have the following for the form-nodal-window
var formWindow = new Ext.Window({
closable: true,
title: 'Show the form',
modal: true,
width: 400,
height: 400,
items: [
{
xtype: 'panel',
border: false,
bodyBorder: false,
height: 100,
html: "Please fill out the form below. Click OK when finished "
},
{
xtype: 'form',
border: false,
bodyBorder: false,
height: 250,
width: 400,
items: [
{
fieldLabel: 'E-Mail Address',
xtype: 'textfield',
name: 'email',
vtype:'email',
allowBlank: false
}
],
buttons: [
{
text: 'OK',
handler: function(){
var fid = folderTree.getSelectionModel().getSelectedNode()
console.log(fid);
Ext.getCmp('exportForm').getForm().submit({
url:'/process_form.php',
params:{fid:fd},
waitMsg:'Sending your request...',
success:function(){
exportWindow.close();
},
failure:function(){
exportWindow.close();
Ext.Msg.alert('Error!', 'There was a problem sending your request.');
}
});
}
}
]
}
]
});
formWindow.show();
Does your TreePanel have an id? If so, Ext.getCmp('that-treepanel-id') must work...
I completely overlooked assigning an ID to the tree.
Thanks, that works perfectly!
-N
Traditional University or MLM University? You Choose
15 Questions to Ask Your Software Vendor
|