Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by X.B on Dec 17, 2008 08:56
open dhtmlx forum
accessing specific element in dhtmlxFolder

Hello, I have a question relating to accessing specific element in dhtmlxFolder

Currently, I am creating a section of a page using dhtmlxFolder list view (with paging enabled)
so the section looks something like this

list of content
| content | --.
| content | |
| content | | ------ content section created using dhtmlxFolder
| content | --'
| paging | --- created custom paging


what I want to do is to have each of the content being able to open so it looks like accordion

the page should be able to

|__ content___|
| | --.
| something | | this part of the page should open up (looking like accordion) when some button in the content is clicked
| inside | --'
|-----------------|
| content |
| content |
| content |
| paging |

now here's the problem. in the xsl file used for populating each item in dhtmlxFolder when I create the content div, I use
'id' + unique number passed by the server for each of the content division id and I am trying to access the same division using document.getElementById('id' + unique number)
but this somehow gives me error saying object does not exist.
I checked the page using IE developer's tool and firefox web developer extension tool and the division does exists with the correct
id specified.

is there something that might be preventing in the dhtmlxFolder javascript code? or am I just doing something wrong?
how can I find the id for a specific content above in dhtmlxFolder?

everything else works fine, this is just something I am trying to add into this page.


Thanks in advance
Answer posted by Support on Dec 18, 2008 05:35
The component doesn't add its own ids or redefine custom ones - so, basically your functionality must work as expected , but next may occur

a) if you are using paging - component will render only visible elements, so you will not be able to access not-visible element by its ID 
b) when element selected it may be recreated (re-rendered in selected state ) so, based on moment when you got reference to the DOM object - it may become invalid after some action ( component prefer to re-render whole element instead of updating its details, so storing of references for later usage is not reliable )