さらに支援が必要な場合は、コードを投稿する必要があります。私がしなければならなかった唯一のことは、ダイアログの高さと幅を大きく指定して、内容がよりよく表示されるようにすることでした.
私が考えることができる唯一の複雑さは、AJAX を介してダイアログの内容を読み込んでいる場合、$(document).ready()
おそらくタブを適切に初期化しないことです。
JSFiddle の例: http://jsfiddle.net/geekman/9WBJt/3/
$(document).ready(function() {
$('#tabs').tabs();
$('#modal').dialog({
height: 500,
width: 600,
});
});
ダイアログの内容を動的にロードする
これは、提供された追加情報に基づく編集です。
したがって、あなたの基本的なアイデアは、次のようなことです。
- リンク/ボタンをクリックすると、コードが起動され、ダイアログのコンテンツが取得されます
- あなたが持っているコードで、コールバック関数として知られているものを渡すことができれば幸いです。ここで、コンテンツの読み込み (またはその他のタスク) が完了すると自動的に呼び出される関数を指定できます。
- コールバック関数で、タブを初期化し、ダイアログを表示できます。
だから、このようなもの:
<button type="button" id="my-link">Load Me!</button>
<div id="dialog">
<div id="dialog-content">
</div>
</div>
$(document).ready(function() {
$('#my-link').click(function () {
//Begin loading your content however you do it.
//In this case I'm using AJAX because it's one of the most common ways to dynamically load content in JavaScript
$.get('http://url-to-your-content.com/my-template', '',
//We can use an anonymous function as our callback function, or define it seperately then call it here.
//$.get() will call it, and put the contents of my-template in the result variable for us to use.
function (result) {
//Insert the result into the div ID dialog-content (I'm assuming the fetched data is HTML).
var dialog_content = $('#dialog-content');
dialog_content.html(result);
//Now, render the HTML in dialog-content as JUI tabs
dialog_content.tabs();
//How display your dialog box
$('#dialog').dialog();
}, 'html');
});
$('#tabs').tabs();
$('#modal').dialog({
height: 500,
width: 600,
});
});