Mark Gibson wrote:
Hello,
I've got a new plugin for jQuery.
It's a simple data model, useful for implementing a client-side MVC
pattern.

The data model is a simple javascript object/array hiearchy.
The plugin provides methods for binding parts of the model to DOM
elements
and/or functions - so that when the value of an element changes the
model
is changed and if the model changes the elements are updated too, or a
function be called on a change too.
It's similar to the XForms concept, but relies on jQuery and
Javascript rather XPath,
and the model would normally also be serialized as JSON.

I'd like to add it to the plugins SVN repository if possible.
It will be licensed with MIT/GPL as jQuery is.

For now it here are some links for it (blurb and demo pages):
http://jollytoad.googlepages.com/mvcusingjquery
http://jollytoad.googlepages.com/model-demo.html
http://jollytoad.googlepages.com/model.js
Thats quite interesting stuff. Some things of my mind:
Use the metadata plugin to specify and read metadata.
It would be nice if the textarea with the serialized model data could be edited. Once you change something, the form is updated accordingly. I'd like to see an example that updates the model after I changed one select, submits it (or parts of it), receives an updated model from the server and updates a different select accordingly. Seems like that is something that should be quite easy to achieve with your plugin. I've never seen "if ('console' in window && 'log' in console)" before, I like that. Is there any difference to "if ( window.console && console.log )", assuming that both objects never default to false if present?

For access to subversion you should contact John directly ( [EMAIL PROTECTED] ).

--
Jörn Zaefferer

http://bassistance.de

Reply via email to