Hello there,
I need help with a problem that I can not understand please …
I use a very simple javascript function that allows users to wait for an HttpRequest or dhtmlx loop (foreachrow). I show or hide a div with transparency and animated gif on my entire page.
Here’s the code, as said above, very basic.
function WhiteWall(){
document.getElementById("waiting").style.display="block";
};
function notWhiteWall(){
document.getElementById("waiting").style.display="none";
};
And the hide/show div:
<div id="waiting" class="transparent">
<table height="100%" width="100%">
<tr>
<td>
<table align="center" style="vertical-align:middle;">
<tr>
<td align="center" valign="middle">
<img src="/images/wait.gif" align="absmiddle"><br> <b>Veuillez patienter...</b>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
The problem is with IE9-10-11, the div does not appear. If I put an alert (), it has time to show, else it directly go to the scripts below.
Here is a specific example of script where it does not work (although firefox is ok):
[code]function SaveAsPan(){
if (cartgrid.getRowsNum()==0) {
alert(“Le panier est vide”);
} else {
WhiteWall();
var vstatus;
ischange = false;
if(document.getElementById('pantype').checked==true){
vstatus = "&O_PANIER.F_PANIERTYPE=Oui";
} else {
vstatus = "&O_PANIER.F_PANIERTYPE=Non";
};
s = "http://..."+vstatus;
loader = dhtmlxAjax.getSync(s);
s = loader.xmlDoc.responseText;
pansid = s;
//alert(pansid);
if(vstatus=='&O_PANIER.F_PANIERTYPE=Oui'){
var ind = 0;
toolbar.forEachListOption('new', function(optionId){
ind = ind+1;
});
toolbar.addListOption('new', pansid, ind, 'button', document.getElementById("O_PANIER.F_LIBELLE").value, 'flag_blue.png');
};
cartgrid.forEachRow(function(rowId){
recstat = cartgrid.cellById(rowId,11).getValue();
if(recstat!='delete'){
m = "http://..."
loader = dhtmlxAjax.getSync(m);
m = loader.xmlDoc.responseText;
}
});
d.setText('PAN'+pansid.substring(7,12)+' - '+document.getElementById("O_PANIER.F_LIBELLE").value+' (Sauvegardé)');
document.getElementById('obj_lnk_blc').style.visibility='visible';
document.getElementById('btnsubmit').style.visibility='visible';
majCount();
dhxWins2.window("w2").close();
ischange=false;
notWhiteWall();
dhtmlx.message({
text:"<span style='color:#00AEEF'>Le panier a été sauvegardé.</span>",
expire:2000
});
};
};[/code]
If possible, I don’t want to use setTimeout() because it never take the sam time to execute.
I’m not 100% sure that a DHTMLX problem, but I have it only with it.
Have you got any idea please?
Loïc