I have accordion with a lot of cells. Accordion placed in layout cell. I would like to scroll layout cell to see accordion cell with specific ID on the top of layout cell. Is it possible?
Hello
Try the next approach:
myLayout = new dhtmlXLayoutObject("parentId", "2U");
a = myLayout.cells("a");
a.setWidth(250);
myAccordion = new dhtmlXAccordion("accordObj");
for(var i=0; i<50; i++){
myAccordion.addItem("a"+i, "a"+(i+1));
}
form = myLayout.cells("b").attachForm([{type: "combo",label: "Combo", name: "format1",labelWidth: "auto",inputWidth: 100}]);
combo = form.getCombo("format1");
for(var v=0; v<50; v++){
combo.addOption([{value:"a"+v, text:"a"+(v+1)}]);
}
a.attachObject("accordObj");
a.showInnerScroll();
combo.attachEvent("onChange", function(val){
myAccordion.cells(val).open();
numb = parseInt(val.slice(1));
a.cell.childNodes[1].scrollTop = numb*26;
});