Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Ram Chander Singh on Feb 26, 2009 07:47
open dhtmlx forum
dhtmlxTabbar - reloading Iframe

Hi,


I have a LAYOUT, inside layout i added Tabbar. Inside tabbar in one tab i am calling external URL inside iframe.

Issue is i want to reload external URL 3 or 4 times onSelect of tab 'Add Items''. My item dosen't get added into basket because all items list goes together till the external page get loaded.

IS THERE ANY WAY TO CHECK EXTERNAL URL PAGE IS LOADED COMPLETELY, THEN SEND second request.

here is my code:

var workspaceLayout = new dhtmlXLayoutObject(document.body, "2E");
var medCell = workspaceLayout.cells("a")
var addItemCell = workspaceLayout.cells("b")
medCell.hideHeader();
addItemCell .hideHeader();
var medGrid = medCell.attachGrid();
medCell.setHeight(127);
var dhxTabbar =workspaceLayout.cells("b").attachTabbar();
dhxTabbar.setImagePath("/javascripts/dhtmlx/dhtmlxTabbar/codebase/imgs/");
dhxTabbar.setHrefMode("iframes");
dhxTabbar.addTab("a1","List","100px");
dhxTabbar.addTab("a2","Add Items","100px");

dhxTabbar.setContentHref('a2','http://www.xyz.com/addItems?reset=t');
dhxTabbar.setOnSelectHandler(function(id){
window.setTimeout(function(){
var frame=dhxTabbar._content[id].childNodes[0];
var itemArray = ['item1','item2'','item3']

for(i=0; i<=3;i++)
{
frame.src = 'http://www.xyz.com/add?addItem='+itemArray [i];

dhxTabbar.forceLoad('a2',frame.src);
}


},1);

return true;
});


Answer posted by Alex (support) on Feb 26, 2009 09:21

If you want to execute some functionality when page is loaded, the best solution is to set body onload event handler at this page - page which is loaded inside iframe:

<body onload="doSomeFunction()">

...