Finding _idd value of a accordion cell using DOM object

We are using accordion 2.6 version.
We have added an onclick event on “dhx_acc_item_label” div.
when click event happens, we are using this dom object’s _idd value and
opening/closing the perticular cell.

Now we are upgrading to 4.1,
I observed in the latest code that, instead of adding _idd value to the div object, its now added to dhtmlxcellobject.

How to get this _idd from “dhx_cell_hdr” div object ?

Hi

please provide code used for 2.1 and some words what do you need this ‘onclick’ event for?

We have a component class which creates and loads accordion object.
the code is

[code]var accordionContainer = document.getElementById(‘accordObj’);
_accord = new dhtmlXAccordion(accordionContainer);
_loadFromXML(objRef.getAccordionXMLFile(), objRef.getAccordionImagePath());
var accordObjDiv = document.getElementById(“accordObj”);
$(accordObjDiv).click(_handleClickEvent);

function _handleClickEvent(eventObject) {
var target = eventObject.target;
if (target && ($(target).is(‘div.dhx_cell_hdr’))) {
// in version 2.6 element div class was ‘dhx_acc_item_label’
var menuId = target._idd;
if (_accord.cells(menuId).isOpened()) {
_accord.cells(menuId).close();
} else {
_accord.cells(menuId).open();
}
}
} [/code]

From above code you can see, we are registering click event on ‘accordObj’.
in _handleClickEvent method, we are opening/closing the menu item using _idd value,
which is used to find the cell.

The above code is just a sample. We need this implementation to handle some other events.

If user clicks on menu item, target will be the same div as the cell.
in version 2.6, this DOM contains _idd value. with version 4.1 its returning undefined.
Is there any way to get this _idd value from the DOM ?

Hi

after cells loaded into accordion, try this

myAcc.forEachItem(function(cell){
cell.cell.childNodes[0]._idd = cell.getId();
});