ethraza
21 Jun 2007, 3:29 PM
Imagem a function that creates my dialogs:
function createbox(...) {
var bdlg = new Ext.LayoutDialog(Ext.id(), {
autoScroll: true,
width: iWidth,
height: iHeight,
minWidth: 150,
minHeight: 100,
modal: bModal,
proxyDrag: true,
shadow: true,
center:{
alwaysShowTabs: false,
fitContainer: true,
fitToFrame: true,
autoScroll: true
}
});
bdlg.addButton(p[0], eval(p[1]), bdlg);
bdlg.body.load({url: sContent, scripts:true, params:sParams})
bdlg.header.update(sTitle)
bdlg.addKeyListener(9, function(i,k,e){e.stopEvent()}, bdlg); // Trying to stop TAB to keep modal
bdlg.addKeyListener(27, function(){bdlg.destroy(true)}, bdlg); // ESC to close
bdlg.show();
return bdlg;
} Now, on scripts I call that function and the returned object go to a variable:
<script>
var bx = createbox(...);
bx.destroy();
</script>
When I call destroy() or hide(), with basicdialog or layoutdialog, it works and close the dialog on FF2 but not works on IE6 or 7.
Why? Is a bug or my mystake?
Thanks!
*** Edited to get the addKeyListener for TAB working!
function createbox(...) {
var bdlg = new Ext.LayoutDialog(Ext.id(), {
autoScroll: true,
width: iWidth,
height: iHeight,
minWidth: 150,
minHeight: 100,
modal: bModal,
proxyDrag: true,
shadow: true,
center:{
alwaysShowTabs: false,
fitContainer: true,
fitToFrame: true,
autoScroll: true
}
});
bdlg.addButton(p[0], eval(p[1]), bdlg);
bdlg.body.load({url: sContent, scripts:true, params:sParams})
bdlg.header.update(sTitle)
bdlg.addKeyListener(9, function(i,k,e){e.stopEvent()}, bdlg); // Trying to stop TAB to keep modal
bdlg.addKeyListener(27, function(){bdlg.destroy(true)}, bdlg); // ESC to close
bdlg.show();
return bdlg;
} Now, on scripts I call that function and the returned object go to a variable:
<script>
var bx = createbox(...);
bx.destroy();
</script>
When I call destroy() or hide(), with basicdialog or layoutdialog, it works and close the dialog on FF2 but not works on IE6 or 7.
Why? Is a bug or my mystake?
Thanks!
*** Edited to get the addKeyListener for TAB working!