BorisMoore / jsviews

Interactive data-driven views, MVVM and MVP, built on top of JsRender templates
http://www.jsviews.com/#jsviews
MIT License
857 stars 130 forks source link

Provide bubbled events when {^{for}} {^{if}} modify DOM content #299

Closed BorisMoore closed 9 years ago

BorisMoore commented 9 years ago

$(self.parentElem).trigger("forArrayChange")

Needed for example so that a data-linked jQueryUI accordion can refresh itself when panels collection is rendered as a data-driven {^{for}} array and the array changes observably.

BorisMoore commented 9 years ago

This has been provide in commit 63. https://github.com/BorisMoore/jsviews/commit/8700d57014cf3590c22565797ed0ecf304a4b504

New dom change notifications feature: A new domChange() method on data-linked tags will raise a "jsv-domchange" event on the parent element. {^{for}} and {^{if}} both use this method to raise a "jsv-domchange" event whenever they modify the DOM as a result of observable data changes. See http://jsfiddle.net/BorisMoore/vrw0kfxb/, and unit tests for "jsv-domchange".