PDA

View Full Version : Accordion and JS-Error



steffenk
9 Aug 2007, 12:41 AM
Hi,

I'm using an accordion on all pages of a site. In Firebug I see one JS-Error coming from time to time (not always!)

this.desktop has no properties
var viewport = this.desktop.dom === document.body ? {} : Ext.get(this.desktop).getBox();




Ext.onReady(function() {
// create accordion
var acc = new Ext.ux.Accordion('acc-hx', {
fitContainer: true
, fitToFrame: true
, fitHeight: true
, initialHeight: 240
, desktop: 'center-accordions'
, animate: false
})

// create panels
var panel1 = acc.add(new Ext.ux.InfoPanel('panel-hx1', {
icon: 'fileadmin/template/neu/img/icons/freunde.gif'
, collapsed:false
}));
var panel2 = acc.add(new Ext.ux.InfoPanel('panel-hx2', {
icon: 'fileadmin/template/neu/img/icons/gruppen.gif'
}));
var panel3 = acc.add(new Ext.ux.InfoPanel('panel-hx3', {
icon: 'fileadmin/template/neu/img/icons/events.gif'
}));
var panel4 = acc.add(new Ext.ux.InfoPanel('panel-hx4', {
icon: 'fileadmin/template/neu/img/icons/info.gif'
}));
acc.setPanelHeight();
});

How can i prevent this error ? I think this is from acc.setPanelHeight();

thx

galdaka
9 Aug 2007, 1:36 AM
Put this message into AAccordion thread: http://extjs.com/forum/showthread.php?t=6388

Thanks in advance,

steffenk
9 Aug 2007, 1:50 AM
sry, too late - i can't move it.

jsakalos
10 Aug 2007, 4:37 AM
Does div "center-accordions" exist?

Undocked panels are attached to "desktop" div. It defaults to document body if not specified. Other option is to specify a ContentPanel of a LayoutRegion div.

steffenk
10 Aug 2007, 9:04 AM
Hi Joszef,

thx for replying.
No, i don't have a center-accordions-div, i don't use the accordion in a LayoutRegion, just as standalone. My html is just like the demo, it's created dynamic by php:



$content.= $this->quickLinks().
'<div id="acc-hx">
<div id="panel-hx1"><div>Meine Freunde</div><div><div class="text-content" style="overflow:auto;">'.$this->myFriends().'</div></div></div>
<div id="panel-hx2"><div>Meine Gruppen</div><div><div class="text-content" style="overflow:auto;">'.$this->myGroups().'</div></div></div>
<div id="panel-hx3"><div>Meine Events</div><div><div class="text-content" style="overflow:auto;">'.$this->myEvents().'</div></div></div>
<div id="panel-hx4"><div>Meine Infos</div><div><div class="text-content" style="overflow:auto;">'.$this->myInfos().'</div></div></div>
</div>';

I'm in a valid xhtml-page, so binding to document.body should be no problem.
What's the best to do ?

steffenk
10 Aug 2007, 11:46 AM
Ahrgg - i'm stupid - i copied from demo and don't think that there was the problem:


, desktop: 'center-accordions'
without having this div. So i didn't got your hint - shame on me :D

sry for bother

jsakalos
10 Aug 2007, 12:05 PM
btw - could you add the link to the demo to your first post? I search everytime and find it on page 4 or 5
There is the versions list in the first post together with links.

steffenk
10 Aug 2007, 1:30 PM
i saw later - the css does not show links very well.