set text of status bar from attachURL page

Hi,

I have a function that loads a dhtmlXWindow, adds a status bar and then loads body content using attachURL.

function doOnRowSelectedOrderGrid(id){
  if (!dhxWins) dhxWins = new dhtmlXWindows();
  dhxWins.setImagePath("images/fam/");
  var orderWin = dhxWins.createWindow("orderGridWindow", 0, 0, 450, 464);
  orderWin.attachURL("orders/loadOrderData.php?id="+id, true);
  var sb = orderWin.attachStatusBar();
}

from the loadOrderData.php page i want to be able to set the text of the status bar.

I have tried several variations like

<script>
  parent.sb.setText('test text');
  parent.dhxWins.window("orderGridWindow").sb.setText('test text');
</script>

but neither of these work can you please help me?

Hi,

orderWin.attachURL(url, true); loads content by Ajax (the second parameter is true), iframe is not used in this case. Therefore, sb.setText(‘test text’) will work. However, sb should by a public variable:

function doOnRowSelectedOrderGrid(id){

sb = orderWin.attachStatusBar();
}

instead of

function doOnRowSelectedOrderGrid(id){

var sb = orderWin.attachStatusBar();
}

awesome… thanks… works a treat…

so if i decalare a variable in a function with var its a private variable but if I do not use var its a public one.

is that correct?

Yes, that is correct