Search code examples
jquery-pluginstemplate-engine

Jquery Microsoft Linking plugin: Any way to set a dirty flag when changes occur?


If you link a form and a JavaScript object array together with Microsoft's JQuery linker plug-in, is there any way to have it set a "dirty" flag in the object properties to let you know that data hasn't been saved yet?

This code comes from here.

var myRecords = {};
$("#RecordTemplate").tmpl(myRecords[0]).link(myRecords[0]).appendTo("#div");

Now we want to myRecords.filter(whereFunction), sending only these "dirty" records to the server. (filter creates a new array with only the elements for which the filter is true).

This post is very useful in making the data linker plug-in work well.


Solution

  • This post by jamiemthomas surely sums up what can be done.