javascript - DOJO and DIJIT can not parse same ID twice? -
i having problem while working dojo dynamically load div content , run parser.parse(dom.byid("maindiv")); respective requires. , works beautifully first time. second time end running problem shows content no longer activated or styled.
on second run remove html in div , replace html basic unparsed text , parse again. guessing has dijit.registry can not find issue have tried clearing out no avail. appreciated.
dojo keeps track of objects / widgets creates specified id. if run parser again on object same id, dojo tries create second instance, there one, should throw error in js console (please check).
you leave id blank, dojo / parse should create id you. dojo allows find dom elements class attributes, way pass div-element parse() function without giving explicit id.
anotherway destroy created widget/object before parse div-element again, take here that:
quote http://livedocs.dojotoolkit.org/dojo/parser#parse
"if try parse same content twice, or parse content mentioning id's of existing widgets, cause exception duplicate id's"
Comments
Post a Comment