JavaScript Data Binding Array
I'm looking for something like Flex's ArrayCollection and ArrayList; a lightweight wrapper a开发者_如何学Goround JavaScript's Array that supports data binding to do something (ie. call a function) on data change.
Take a look at jQXB Expression Binder. It does exacly what you need, binding capabilities, templating and messaging. http://www.jqxb.altervista.org
I don't think that javascript has any similar functionality. I believe the best solution would be a function that adds or updates an array and runs other functions from within that like rerender the list or page.
Backbone.js Collections is a very popular implementation of this. Many of the libraries covered in TodoMVC also have something like evented collections. Unfortunately they do more than just this one thing.
精彩评论