Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExtJS bidirectional Data Binding? Or alternatives

I'm a pretty experienced Flex/.NET developer who is now learning html5/javascript. I've been playing with Ext Core and ExtJS for the last few weeks and I'm interested in whether/how folks are using these libraries to do bi-directional data binding on data that is not list based.

It seems like most of the binding support is directed at binding rows of data to grids. I'm interested in binding UI elements to arbitrary POJOs that are not list-based data.

Maybe I'm just not looking in the right places, but I'm not finding support for this.

I'm really interested in hearing what folks are doing in Ext OR what folks recommend as an alternative.

like image 433
Boon Avatar asked Oct 11 '22 15:10

Boon


1 Answers

Although there is no out-of-the-box solution like the @Bindable from Flex for example, Extjs does offer the infrastructure to create bindings. If you have a look at http://blog.dnet-ebusiness-suite.com/2012/03/data-binding-in-extjs-4-grid-form.html you'll see a demo for this where the models (filter instance and record instance, instances of Ext.data.Model managed or NOT managed by a store) are bound to different views. The functionality is achieved with a thin framework built on top of Extjs.

On the other hand, to bind arbitrary POJOs is exactly the same story, those have to implement an Observable and fire themselves some property change events which can be listened. The blog posts and the framework itself gives a good starting point on how to do this.

Another way/concept is http://www.sencha.com/forum/showthread.php?60809-Ext.ux.data.BindMgr-Databind-Manager which i used with extjs 3 and works fine.

like image 99
matat Avatar answered Oct 18 '22 11:10

matat