Problem with setContentHref

I have a problem where I get the error:

this.cells(id) is null http://localhost/~jorgy/scheduleBot/web/dhtmlx/dhtmlxTabbar/codebase/dhtmlxtabbar.js Line 200

I have narrowed it down to a small sample. Here is the html file:

[code]

Load data in tabbar by ajax

[/code]

Here is my XML config file (taken from a provided sample):

<?xml version="1.0"?> <tabbar> <row> <tab id="b1" width='100px'>Tab 1-1</tab> <tab id="b2" width='100px' selected="1">Tab 1-2</tab> <tab id="b3" width='100px'>Tab 1-3</tab> </row> </tabbar>

It doesn’t matter what I try to load into the tab, I get the same error.

Any help would be appreciated!

Thanks,

Eric

loadXML method uses Ajax. So, data are loaded asynchronously.
Therefore, you need to call setContentHref on xml loading (the second parameter of loadXML method):

tabbar.loadXML("config.xml",function(){ tabbar.setContentHref("b1", "users.html"); });

Hello,

Thank you for your prompt response. That does work for me. However, what if I wanted to load content into that tab in another part of an application, say from a button, or onClick, or a menu?

Thank you,

Eric

Probably the tabbar will loaded when you click on the button.

However, there is the onXLE event that occurs after xml loading:

var xleH = tabbar.attachEvent(“onXLE”,function(){
/your code here/
});

to detach event handler you may call:
tabbar.detachEvent(xleH)

Thank you!