开发者

JavaScript Data Binding Array

开发者 https://www.devze.com 2023-02-14 18:42 出处:网络
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)

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消