An id for every div.

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
Post Reply
TedTheDinosaur
Posts: 1
Joined: Fri Sep 12, 2014 9:59 pm

An id for every div.

Post by TedTheDinosaur »

It would be nice if every div that the ajax toolkit created had an id. Most 'top level' elements do have IDs, but some 'component divs' don't. Because of this, these elements are a little difficult to get at when testing.
For instance, if i were writing tests for my zimbra app and wanted to send a mouse event to the first node of a DwtTree, i would have to do something like the following:
getParentObjectByDivID(id){...}._nodeCell.firstChild.dispatchEvent(evt);
This is 'somewhat' non-intuitive. What is more intuitive is something like this:
document.getElementById(id).dispathEvent(evt);
Additionally, it might be useful to allow developers to assign their own ids.

Something like:
new DwtTree(parent, 'UserListTree');
which might change our event dispatching code to something like this:
document.getElementById('UserListTree' + '-expand').dispathEvent(evt);


What do you think?
-ted
Post Reply