ExtJS bidirectional Data Binding? Or alternatives - data-binding

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.

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.

A follow up... I never did find an ExtJS approach and moved on to other js frameworks/approaches and along the way learned about knockout: http://knockoutjs.com/ which is pretty darned awesome!

Are you looking for the BasicForm functionality? (Particularly: loadRecord)
If you want readonly display you can use DisplayFields or disabled TextFields or similar.

Take a look at jQXB , http://www.jqxb.altervista.com. It's seems to provides a very easy and powerfull api to bind data with html elems

Related

Generic re-usable gridview with sorting,paging, filtering for asp.net web application

I have been given a task of creating a common Gridview component which has following features:
Paging
sorting
Filtering
The objective is to reuse the component in almost all the web pages (.aspx), so that the look and feel, layout and behaviour remains uniform across the web site.
The grid has to be lightweight, preferably ajax based. I had several thoughts in mind:
extend the current asp.net Gridview component.
Implement a very own custom solution with ajax method pulling data, rendering happens on client side using some jquery templates..etc.
I am not sure where to start with. The requirements i have been give just says that create a common Grid component so that all others in my team can re-use the same component .
Please give me insight into which way I should approach the implementation so that in future this component is scalable as well as in the near future its re-usable across the site.
The jQuery plugin datatables.net is very light weight and has all the features you need. You could use that.
No need to reinvent the wheel, there are tons of opensource and pay grids out there to do what you wnat - Check out this grid (with complete source). One of the nice features is that you can add a toolbar which you could use for your filtering.
http://jqmvcgrid.codeplex.com/

JavaFX Datagrid

Im in the verge of starting a new RIA development. We've been using Flex/Flash for the last 2 years but we were considering using a more OS approach so we though giving JavaFX a try since it seams the only solid option available. However after a couple of days of research we found out that there is not such thing as a datagrid for it, at least not in the core API. For those unfamiliar with Flex, a Datagrid is a component that allows you to display a collection of data in column-row layout (much like a HTML Table on steroids). The beauty of it is that you only need to worry about the data itself as the component does pretty much the rest (sorting, column dragging, etc).
Im afraid to ask... but is there something slightly similar for JavaFX?
We require nothing as fancy as Flex Datagrids/AdvancedDatagrids, we only require a easy, straight forward way to display grids of data that are able to have a little of interaction like clicking, sorting and that are able to display images, buttons, etc. without having to download a ton of different jars.
If there isnĀ“t something out there... This would be a shot in the back of the head to the idea of giving javaFx the chance to compete with flash on our project (which is sad).
I really cant believe the SUN people didnt include something like this on the core API...
There is currently no datagrid you can use JTable for that. Such a thing should be available in the next release of JavaFX I think. See my answer here for more information about available JTable implementations. You mentioned the JFXtras project with that you are able to embed those Swing components into JavaFX.
There are external companies selling such a component. E.g. do a web search or look here
For apache pivot you should ask them directly for the pros and cons; they are very responsive and honest.

Proper implementation of MVP with complex controls

I'm currently implementing a project using asp.net, c# and the MVP (Model-View-Presenter) pattern. The main purpose of this solution is to deliver a graph to the consumer, to be used by a variety of systems. It is basically a custom graph server.
The view page in this particular case has an MSChart control on it, which has to be dynamically populated and configured based on parameters in the QueryString. This can be as diverse as totally different types of data sets, display modes and so on, using a lot of the properties of the chart control.
Many of these properties are again of types which are particular to the chart control and would require the same dependencies as the chart control itself if they are to be set by the presenter.
I'm trying to figure out the best way to expose the properties to the presenter so it can work its magic.
Should I:
Just expose the whole chart object and live with a system.web type dependency in the presenter project?
Make accessor and translation properties for all of the chart control properties so that I don't have the dependency, but add lots of complexity?
Other, that I haven't thought of?
To me it seems that it would be against the MVP pattern to bubble a display control up into the presenter, but it seems that trying to map all the properties to DTOs or similar would be a lot of work that would add a lot of complexity, and while the solution would be somewhat more loosely coupled, I'm not sure the gain would be worth it in this case.
How would you implement something like this, given MVP?
While doing some more research on this topic, I found the following blog post on adding a Presenter Model to handle complex view controls, to map between the view and the presenter. It actually made a lot of sense to me, and it's an idea I think I'm going to follow up on and try.
http://mikewagg.blogspot.com/2009/01/managing-complexity-with-mvp-and.html
In fact, Martin Fowler has written on this as well:
http://martinfowler.com/eaaDev/PresentationModel.html
Check out Automapper. Makes translating from a Business Object to a View Model almost effortless. The general idea is your View Model should only have primitive system types if possible to avoid formatting/conditionals in your view.

Looking for examples of simple web-based form designers

I have a requirement to implement a "simple" web-based form designer that allows "simple" users to create their own web-based forms. I've come across these things in rich clients, such as Outlook and Acrobat, but my requirements are much simpler and must be web-based.
Pretty layout, custom validation, complex fields and types are simply not a factor. Ideally I would like to find something that is neat like this very SO question composer, in which I'm typing right now, plus the ability to drag a text input box or a checkbox right into the text. Output could be as crude as this:
What is your name? [Fred Bloggs]
Do you have an internet? [x]
I'm using asp.net but the backend technology doesn't really matter as I fear this is all javascript! No need to consider old browsers. Any examples links would be helpful, as well as suggestions for existing open or commercial components. Thank you!
Tried Frevvo ?
Here is a pretty neat one based on jquery Ajax Form Builder
Try FormThis. It allows you to create an Online Web Form at no cost. Drag & Drop designer, Unlimited Fields, Submit/Responses, Calculations, Validation, etc. Can output to PDF if required.

Know a good templated ASP.Net Calendar control?

I'm looking to find a decent calendar control for an ASP.Net application that allows each day to have an "ItemTemplate" type of declaration so that I can list things that are happening within each day. Something like the Club Starter Kit, only more robust and that can handle other datasources besides DataSets and DataTables.
I'm thinking about fixing that control to handle other types of datasources, but would much rather go with something better if I can find one. I'd even be able to work with some kind of client side "calendar" if one was available.
We actually ended going with the calendar control out of the Club Starter Kit (http://clubstarterkit.codeplex.com/) as the updated versions did what we needed them to do.
BaseCalendar may work (you can customize everything).

Resources