Skip to content
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

Feature Request: updateLinkedJSON() Function #12

Open
bluedevil2k opened this issue Nov 8, 2010 · 1 comment
Open

Feature Request: updateLinkedJSON() Function #12

bluedevil2k opened this issue Nov 8, 2010 · 1 comment

Comments

@bluedevil2k
Copy link

I just finished an article on this plugin and wanted to pass along some things I thought could make it easier to work with. Right now I think the plugin is somewhat tough to use in that it exposes only 2 functions and doesn't offer a lot of helper functions (Ignoring the fact that the documentation isn't up to date).

First feature request - a function called updateLinkedJSON(json, dataObj)

Basically, a utility function in the plugin that does this

$.each(json, function(key, value){
$(dataObj).data(key, value );
});

and be called in an example like this:

$.get("ajax.jsp", {}, function(data){
updateLinkedJSON(data, dataObj);
}, "json");

@jamiemthomas
Copy link

The purpose of the plugin is to support one and two-way linking between form input elements and objects (and possibly elem-elem and object-object). It does not seem this suggestion speaks to the goals of linking objects to elements, but just a convenient way to copy data from another location into the linked object. There are many many ways an ajax request may result in an update to a source object, and it would seem this would best be left up to the developer, especially in cases where jQuery already provides such an elegant (almost one line) means of accomplishing the goal from your example.

At present, the goal of linking form elements to data is itself unfulfilled, as the current plugin only supports text and single-select controls, not checkboxes, checkbox lists, radio buttons, or multi-select lists, so priority should first be placed on implementing this and providing real-world examples and articles on how to establish links and leverage the power of converters to do many interesting things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants