I have to say thank you to everyone who has created this awesome resource. And to everyone that posts on these forums.
I am having a tough time opening up multiple dialogs. I want to create them on the fly, so I will not have DIVs coded into the page. What is happening is, first dialog created fine and is draggable..etc. Second dialog is created fine and is draggable etc.. But once the second dialog is created, the first one no longer responds to anything. I am assuming it is because I am reusing a variable/element somewhere, but for the life of me I can not figure it out.
My HTML:
Code:
<div id="hello-dlg" style="visibility:hidden;position:absolute;top:0px;">
<div class="x-dlg-hd">Search Assets</div>
<div class="x-dlg-bd">
<div id="center" class="x-layout-inactive-content" style="padding:10px;"></div>
</div>
</div>
My Javascript (this is called from a click handler of a treeview)..There is also a tree inside of the dialog, but that works fine.. of course it disappears from the first dialog when the second dialog is loaded.
Code:
NewAssetListWindow = function(width, listNode){
//windowCounter++;
var dialog = new Ext.LayoutDialog("listwindow_" & listNode.id, {
autoCreate: true,
modal:false,
width:200,
height:300,
shadow:true,
minWidth:300,
minHeight:300,
proxyDrag: false,
title: listNode.id,
center: {
autoScroll:true,
autoCreate: true
}
});
dialog.addKeyListener(27, dialog.hide, dialog);
var layout = dialog.getLayout();
layout.beginUpdate();
var CP = Ext.ContentPanel;
//layout.add('center', new CP() Ext.ContentPanel('center', 'autoCreate: true'));
layout.add("center", new CP(Ext.id(), {title: "Close Me", closable: true, autoCreate: true}));
layout.endUpdate();
//do a tree
var windowTree = Ext.tree;
var windowtree = new windowTree.TreePanel('center', {
animate:true,
loader: new windowTree.TreeLoader({dataUrl:'data.aspx',
baseParams: { type: 'folderchildren', guid: '', userguid: ''}
}),
enableDD:true,
containerScroll: true
});
// set the root node
var root = new windowTree.AsyncTreeNode({
text: 'My List Directory',
draggable:false,
//children: new Tree.TreeLoader({dataUrl:'data.aspx?d=1}),
id:'source_' & listNode.id
});
windowtree.setRootNode(root);
// render the tree
windowtree.render();
root.expand();
dialog.show();
}
Any direction is appreciated.. I would really like to solve this so I can move on.
-Mac