PDA

View Full Version : BasicDialog with markup - tabs change position at each display



rajesh_pv
27 Apr 2007, 10:11 AM
I tested in FF and IE6.0 both start shifting the tab set down by window caption amount , each time I hit "Hello World" button to display
the shift gets appended !, is'nt it funny :D

this is what I tested
try
{
var dialog;
if (!dialog)dialog = new Ext.BasicDialog("hello-dlg", {
autoTabs:true,
width:500,
height:300,
shadow:true,
minWidth:300,
minHeight:250,
proxyDrag: true,
animateTarget:'show-dialog-button'
});
dialog.show();
}
catch(e)
{
alert(e);
}

in html-body I have as

<input type="button" id="show-dialog-button" value="Hello World" onClick="showDialog('hello-dlg')" /><br /><br />

<!-- The dialog is created from existing markup.
The inline styles just hide it until it created and should be in a stylesheet -->
<div id="hello-dlg" style="visibility:hidden;position:absolute;top:0px;">
<div class="x-dlg-hd">Hello Dialog</div>
<div class="x-dlg-bd">
<div class="x-dlg-tab" title="Hello World 1">
<!-- Nested "inner-tab" to safely add padding -->
<div class="inner-tab">
Hello...<br><br><br>
</div>
</div>
<!-- Auto create tab 2 -->
<div class="x-dlg-tab" title="Hello World 2">
<div class="inner-tab">
... World!
</div>
</div>
</div>
</div>
</div>

tryanDLS
27 Apr 2007, 10:21 AM
That's problably b/c you moved the onclick to the html and your scope is blown - the dom elements are getting created multiple times.

rajesh_pv
27 Apr 2007, 10:47 AM
So if I want to load the dialog-markup from server and then make a call to show
how do I do that. You guys are really good, and I really like YUI/EXT (the best)

tryanDLS
27 Apr 2007, 10:58 AM
Do it like the example originally did. Add the click handler in JS code, not inline in the html.

rajesh_pv
27 Apr 2007, 11:13 AM
I think this worked

>>> var dialog;

function showDialog( dialogID)
{
///var dialog; /////// I moved this var outside the function call
so that contruction it gets called only once as Jack's code

try
{
if (!dialog)dialog = new Ext.BasicDialog("hello-dlg", {
etc,- - - -

Thanks lot,
basically I am trying to load this markup as ajax call then display!
I will update this thread when it works , I am thinking to integrate with Sarissa for Xml markup instead of JS to generate markup on fly, hope I am not doing too crazy !!