Title: addin dilog to panel Post by: devnull on March 13, 2012, 03:42:46 AM Hi;
I need to dynamically add elements to a tab and are having problems with the dialog panel. I want to add them to the tab as there are many tabs and when a tab is closed I want to also destroy the dialog, and it seems the most logical way to do it. First I check if the tab exists and add it if it doesnt. Then I append the dialog <div> container which is loaded correctly to the tab. but as soon as I call the dialog, the div container is removed from the tab and appended to the body. How can I dynamically add to the tab ?? Code: // if NOT tab then add it. Title: Re: addin dilog to panel Post by: lusabo on March 13, 2012, 07:39:15 AM Try this way:
$("#blah").html([your html data]).dialog(); Title: Re: addin dilog to panel Post by: devnull on March 14, 2012, 11:39:31 PM Hi;
Thanks so much for helping, but the problem is not that I can't add a <div> container to a tab, but the fact that the dialog script appears to remove itself from the tab, and append itself to the <body>. Here's an example, the div is added successfully to the tab, and as soon as the dialog() function is executed, the dialog is created and append to the <body> and not to Tab1. Code: <script type="text/javascript" src="../jquery-1.7.1.min.js"></script> Title: Re: addin dilog to panel Post by: stworthy on March 15, 2012, 06:23:57 PM Why add dialog in a tab panel? Add 'inline' property to true to prevent from moving dialog to <body>. If you want to display some information in tab panel, maybe the panel is more fit for you.
|