First of all, sorry for my bad English. I have read all posts with same subject without success because it seems I wrote same code.
Problem:
Dialog appears when first page is loaded (good). I close this dialog, switch tabs to '?' and come back on 'accueil' tab (index 0) where dialog must appear for selecting data file. The overlay fills the window, but dialog is not shown.
Here is my code :
$(function() {
var $dialog = $( "#dialog" )
.dialog({
autoOpen: false,
modal: true,
resizable: false,
draggable: false,
close: function(event,ui) {
form[ 0 ].reset();
}
});
$dialog.dialog('open');
$(window).resize(function() {
$('.headet').height($(window).height()-55);
$('.subet').height($(window).height()-95);
});
function ajaxid(tabid){
$(tabid).empty();
$(".ui-jqgrid").remove();
var url='pages/'+tabid.substr(1)+'.html';
$.ajax({
url:url,
type:'GET',
dataType:'html',
success:function(donnees){
$(tabid).html(donnees);
$(tabid).scrollTop(0);
}
});
}
var $tabs=$('#tabs');
var $subtabs=$('.subtabs');
$tabs.tabs();
$tabs.removeClass('ui-widget-content');
//*******************
// CLIC APPLICATION
//*******************
var pidtab, sidtab=0;
$tabs
.tabs({
disabled: [1,2,3,4,5],
activate:function(event,ui){
var index=$tabs.tabs("option", "active");
pidtab=$tabs.find(" ul>li a").eq(index).attr('href').substr(4);
$("#sub"+pidtab).tabs('option','active',0);
var tabid='#sub'+pidtab+'1';
sidtab=tabid.substr(1);
if($(tabid).hasClass('p10')){
ajaxid(tabid);
}
var tabOpts={};
switch(index){
case 0:
$dialog.dialog('open');
break;
case 6:
tabOpts = { disabled: [2,3,4]};
break;
default:
}
$subtabs.tabs(tabOpts);
}
});
$subtabs.tabs();
$subtabs.removeClass('ui-widget-content');
//**************
// CLIC MODULE
//**************
$subtabs.tabs({
activate:function(event,ui){
sidtab=ui.newTab.attr("aria-controls");
if($('#'+sidtab).hasClass('p10')){
ajaxid("#"+sidtab);
}
}
});
$('ul.ui-tabs-nav').removeClass('ui-corner-all').addClass('ui-corner-top');
});
</script>
and the html part with dialog box :
<body>
<div id="dialog" title="Ouverture">
<form>
<fieldset class="ui-helper-reset">
<label for="data_file">Fichier</label>
<input type="text" name="data_file" id="data_file" value="" class="ui-widget-content ui-corner-all">
</fieldset>
</form>
</div>
Probably it is a little thing which breaks program, but I can't find where and why this happens. As I need to select data file for continuing, I hope somebody will have some precious time to give me some help. Many thanks in advance for that. Have a nice day.