I don't understand why you need to remove the tabs at all. The code
you posted looks like it's not required (removing and adding again).
Couldn't you just disable the tabs? If you need them to be hidden, you
could adapt the CSS for a disabled tab. The next problem might be that
you need to add/enable the tabs in the callback of the Ajax load (this
although depends a bit on what you're loading).
$('#submit').click(function() {
var $tabs = $('#tabsDiv > ul').data('disabled.tabs', [0, 1]);
$('#Updatable').load('...', function() {
$tabs.data('disabled', []);
});
});
--Klaus
On 10 Dez., 23:15, barkha <[EMAIL PROTECTED]> wrote:
> I have a form that uses tabs - however I need to use Ajax to update
> portions of the form. Trouble is - after the ajax load, the events
> bindings are messsed up and re-attaching has very ugly results!
>
> Here's the code -
> <pre><code>
>
> <div id="tabsDiv">
> <ul id="test">
> <li><a href="#one">One</a></li>
> <li><a href="#two">Two</a></li>
> </ul>
> <div id="Updatable">
>
> <div id="one">
> original message 1
> </div>
> <div id="two">
> original message 2
> </div>
>
> </div>
> <input type="submit" id="submit" />
> </div>
> <!---</form>--->
> <script type="text/javascript">
> $(document).ready(function()
> {
> init();
> $("#submit").click(function()
> {
> $("#tabsDiv > ul").tabs("remove", 1);
> $("#tabsDiv > ul").tabs("remove", 0); // NOTE I tried
> destroy - but it was worse
> $("#Updatable").load("http://wcorptw6r7p7d1/VehicleStockIn/
> Test/UpdateTabText");
> $("#tabsDiv > ul").tabs("add", "#one", "One",
> 0);
> $("#tabsDiv > ul").tabs("add", "#two", "Two", 1); // I
> tried init() here but it did not work.
> });
>
> });
> function init()
> {
> $("#tabsDiv > ul").tabs();
> }
> </script>
>
> </code></pre>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---