leora
leora

Reputation: 196589

is it possible to stick jquery ui tabs inside of a jquery ui dialog

i have a web page that i want to load dynamically (ajax) into a jquery ui dialog. the page has multiple jquery tabs and when i load this into the dialog each tab is showing up as a regular link and the tab widget is not shown. Is this a known issue? Is there any workaround to support having jquery ui tabs inside of a dialog.

Upvotes: 8

Views: 7512

Answers (2)

tvanfosson
tvanfosson

Reputation: 532505

You might want to add an open handler to retrieve your content and set up the tabs when you do so.

$(function() {
    $('#dialog').dialog({
        autoOpen: false,
        modal: true,
        buttons: {
            'OK' : function() {
                        $(this).dialog('close');
                   },
            'Cancel': function() {
                        $(this).dialog('close');
                   }
        },
        open: function(event,ui) {
           $(ui.panel).find('div')
                      .load('http://www.example.com')
                      .find('.tabs')
                      .tabs();
        }
    });
    $('.dialog-button').click( function() {
        $('#dialog').dialog('open');
        return false;
    });
});

<div id="dialog"  title="Dialog" style="display: none;">
    <div class="dialog-content">
    </div>
</div>

Upvotes: 6

stephen776
stephen776

Reputation: 9234

yes its possible. here is a simple example ...

JS Fiddle Example

Upvotes: 8

Related Questions