Subscribe to Blog.Parse(typeof(PsychoCoder), Richard McCutchen);        RSS Feed
-----

jQuery Data Linking - Coming to a plug-in near you

Icon 2 Comments
Hey readers, sorry for the absence, been kind of busy lately but never fear I'm still here :)

Anyhow on to the topic of this post. Microsoft has recently made a proposal to the jQuery Project outlining data linking, properties of an object linking to one another. That would allow changes to a property on an object (Object A) to affect a change in the property on a secondary object (Object B).

Quote

Termed “data linking”, the new plugin would allow changes made to a property of one object to effect a change on the property of a secondary object.


It would use the jQuery Special-Event API to create an event that will fire when a property of an object is changed, as long as the property is bound. I know there are quite a number of jQuery programmers here on Dream.In.Code and I wanted to make sure they all seen this new addition and I think it would make a lot of things simpler when it came to client-side work. It would look like this (an example from the jQuery Blog):

var person = {};

$(“#name”).linkTo(“val”, person, “name”);

$(“#name”).val(“foo”);

alert(person.name); // foo

// … user changes value …
alert(person.name); // user typed value



For Web Developers I think this would be a great addition to jQuery, and would really simplify some things when binding object properties and trying to keep track of what has been changed and what hasn't. I also think it would, maybe smaller than I think, help improve performance as we wouldn't always have to search the DOM for a properties value, it would be available in an easier more efficient manner.

I also like the fact that Microsoft submitted it as part of the jQuery Core Library and not some Microsoft version (or hosted version) of jQuery or some plug-in. While I'm an avid Microsoft supporter, and don't see anything changing that anytime soon, it's nice to see them starting to contribute, albeit small, to the open source community after all these years, but that's a topic for a different discussion.

Just thought I'd share this proposal with my readers :) More can be found on this proposal here

2 Comments On This Entry

Page 1 of 1

girasquid Icon

29 April 2010 - 08:10 AM
To be honest, this seems like a much better fit for a plugin than for the core. You can already build the same functionality using the core - so doing it as a plugin that just wraps the methods you'd be calling anyways seems like a better option than increasing the size of the library for users who may not want to use data linking.

I guess time will tell.
0

PsychoCoder Icon

29 April 2010 - 10:11 AM
girasquid I did kind of miss-speak and will rectify that in the edit. It is for a plug-in for the core library, not some Microsoft hosted plug-in, if that makes sense
0
Page 1 of 1

Trackbacks for this entry [ Trackback URL ]

There are no Trackbacks for this entry

December 2014

S M T W T F S
 123456
78910111213
141516171819 20
21222324252627
28293031   

Recent Entries

Search My Blog

0 user(s) viewing

0 Guests
0 member(s)
0 anonymous member(s)