Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Saurabh Malviya on Jan 18, 2010 12:49
open dhtmlx forum
DHTMLX Accordion open() & attachToObject() shoots up CPU usage

Hi,
I downloaded the dhtmlxAccordion v2.5 and implemented it. Here are steps I followed:
a) Created a div(id="accordObj") which I wanted to make Accordion container.
b) DHTMLX Accordion instantiaion
dhxAccord = new dhtmlxAccordion('accordObj');
c) Made it MultiMode
dhxAccord.enableMultiMode(true);
d) Added items to Accordion and attached object to each item.
var count = 0;
while(document.getElementById('object'+count)){
dhxAccord.addItems('a'+count,'B'+count);
dhxAccord.cells('a'+count).attachObject('object'+count);
count++;
}

this attachObject() causes unexpected delay while loading and causes the browser to hang.
Number of iterations are just 10 and it shouldn't be the problem.
Same is the case with Expand All functionality which I achieve by below piece of code:

dhxAcccord.forEachItem(function(item){
if(!item.isOpened()){
item.open();
}
});
Not sure but problematic code is attachURL() in dhtmlxcontainer.js that unnecessarily gets called 224 times in both the cases.
Kindly provide me the solution so that I can successfully implement Accordion with good performance.


Answer posted by Alex (support) on Jan 19, 2010 06:49

Hello,

please provide the complete demo to recreate the issue. The sample can also be sent to support@dhtmlx.com