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

unlink doesn't clean up the added jquery data member #32

Open
wshaver opened this issue Jun 22, 2011 · 3 comments
Open

unlink doesn't clean up the added jquery data member #32

wshaver opened this issue Jun 22, 2011 · 3 comments

Comments

@wshaver
Copy link

wshaver commented Jun 22, 2011

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.

@aw-emberex
Copy link

I can confirm this issue exists as well. +1

@wshaver
Copy link
Author

wshaver commented Jun 22, 2011

This can be done manually as follows:

jQuery.removeData( rowData, undefined, true );

@D1g1talEntr0py
Copy link

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;
        }

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

3 participants