Hi,
Currently and if I understand well, updates thanks to DOM method of Dominus
- happen at the territory level (ie as a child of an existing Dom element, ultimately at the body level :
DOM.add ("element", "body"); )
- Only those elements are considered for update and the update is a full HTML replacement through
innerHTML Dom property.
- Also the underscore convention (eg
element_input) allows to get the right root element (element) and update from that root if exists.
I have thought about another (complementary) way of updating DOM with more granularity but this requires additional concept. The idea is to use the HTML key (HTML[html_key]) as the id of the tag. This could be
- either chosen as an attribute (not ideal)
- or calculated as a UID (better)
- or both
The usage could be like this (if calculated)
var DOM = new Dominus();
// UID is generated behind the scene creating HTML[generatedUID] corresponding to myElement
var myElement = DOM.element ({tag:'div',class:'myClass'});
DOM.class.add(myElement.id, 'myClass2'); // or simplier DOM.class.add(myElement, 'myClass2');
In the proxy process, update could then be managed by the function replaceChild
replacedNode = parentNode.replaceChild(newChild, oldChild); with parentNode=oldChild
What do you think? (hope I was clear)
Hi,
Currently and if I understand well, updates thanks to DOM method of Dominus
DOM.add ("element", "body");)innerHTMLDom property.element_input) allows to get the right root element (element) and update from that root if exists.I have thought about another (complementary) way of updating DOM with more granularity but this requires additional concept. The idea is to use the HTML key (
HTML[html_key]) as the id of the tag. This could beThe usage could be like this (if calculated)
In the proxy process, update could then be managed by the function
replaceChildreplacedNode = parentNode.replaceChild(newChild, oldChild);with parentNode=oldChildWhat do you think? (hope I was clear)