jquery-datalink
jquery-datalink copied to clipboard
unlink doesn't clean up the added jquery data member
After calling something like: $("input", row).link(rowData);
The rowData object will get a member like jQuery15109948021615406466 which points to an object. I believe this object is used to manage the link.
Calling unlink or removing the input from the dom does NOT remove the member. $("input", row).unlink(rowData); // jQuery15109948021615406466 still exists
I'm running into issues with getting some data via json, binding to a form, changing the data, then attempting to send it back to the client but failing because of these extra members.
I can confirm this issue exists as well. +1
This can be done manually as follows:
jQuery.removeData( rowData, undefined, true );
I created a function to retrieve the data object and remove the expando. This is non-destructive and leaves the original backing object intact.
getFieldData: function() { var fieldData = {}; this.each(function() { fieldData = $.extend({}, this); delete fieldData[$.expando]; }); return fieldData; }