-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bind data back to form #7
Comments
I'm glad you like it and are finding it, somewhat, useful. Currently, I On Sat, Nov 15, 2014 at 4:55 AM, zevero notifications@github.com wrote:
|
The plugin should now listen to the form reset event, and update the bound data accordingly. I added a simple test case for this under the tests, and it seems to be functioning correctly. Let me know if you run into any problems. |
Hi! Thank you for this great addition! So I studied your code for quite a bit and found out, that I can change any field when I append .trigger('change'). But of course using the reset handler is even better. I am using your plugin for an offline-capable single-page-application. Before I did some projects with angular, Backbone and Ember and I ended up writing quite complex plugins for all those frameworks. So I made my own, dead-simple mimicing the modules/actions (like in symfony1) using page.js and (one-way) templating with dot.js. So in the end, I just have a bunch of loosly coupled (self-contained) mini pages. Data is just sitting in closures, avoiding any heavy structures with state. I was just in need for an equally simple form-binding. So I looked around and came across yours - which I like best and use currently, but I am still looking for something even easier.
So in the end, with the convention, that the id of the form-element is the root of the inputs I want to have a similar api to jquery.val():
Well the function needs three variables, since I can not simply do data[changedpath] on a nested structure. Maybe I dont need nesting anyway ... This is - of course - something quite different to your project but might use a big portion of your code. May I have your consent to use your code to build this mulitval plugin? |
Hi, I like this simple plugin.
So I just do
and all changes to the form are happily reflected in data.
But now I want to add a clear button for the form. If I clear the data fields, nothing is happening to the forms and if I clear the form fields nothing is happening to the data fields.
So how can I clear input1? I am not happy with my current workaround:
It is clear that without polling or Object.observe(), a simple change in the data object can not be reflected. But is there some kind of trigger, so that I can tell the plugin that data has changed?
A simple val() change of a form field is not enough to change data...
Can you give me some advice?
Thank you!
The text was updated successfully, but these errors were encountered: