Call back to toolbar in accordion on URL loading

I would like to be able to update the toolbar after the iframe url has loaded. How do I reference the toolbar in the Accordion from within the ifr.onload function?

var toolbar = dhxAccord.cells("ac_1").attachToolbar();
    toolbar.setIconsPath("assets/dhtmlxSuite/dhtmlxToolbar/samples/common/imgs/");
toolbar.addButton("open", 0, "Edit", "open.gif", "open_dis.gif");

var ifr = dhxAccord.cells("ac_1).getFrame();
ifr.onload = function(){
	if(this.contentWindow.contentSize() > 200){
 		toolbar.addButton("expand", 4, "Expand", "selection.gif", "selection.gif");
	}
}

Note: contentSize() is a script in the content of the iFrame that tells me the clientHeigth of the iframe.

Hello,

try to use “onContentLoaded” event instead,

  1. add some code to your accorion cell (this code will included into sources from now):

dhxAccord.cells(id)._doOnFrameContentLoaded = function(){ dhxAccord.callEvent("onContentLoaded",[this]); }

  1. then attach event:

dhxAccord.attachEvent("onContentLoaded",function(cell){ // do your actions with toolbar here, // to get cell id - call cell.getId() });

  1. and now you can attach URL:
dhxAccord.cells(id).attachURL(url);