Skip to main content

Search and Top Navigation

#8966 closed bug (invalid)

Opened January 16, 2013 10:49AM UTC

Closed February 12, 2013 08:55AM UTC

Jquery ui widget copy in IE7 and IE8

Reported by: grathad Owned by: grathad
Priority: minor Milestone: none
Component: ui.widget Version: 1.9.2
Keywords: Cc:
Blocked by: Blocking:
Description

Hello, I run into a strange behavior on jquery ui (tested on jquery 1.8.3, jquery-ui 1.9.2).

I have a parent and child widget, on the _create method of the parent I give the parent's self reference to the newly created child.

When I try to access this reference from within the child all the function and properties declared after the building of the child are not available.

(function ($) {

$.widget("ui.parentWidget", $.ui.mouse, {

version: "@VERSION", widgetEventPrefix: "parentWidget",

_create: function () {

var self = this;

self.child = $("<div/>")

.childWidget({ parent: self })

.appendTo(self.element);

self.parentName = "parent";

},

parentFeature: function() {

return "feature";

},

getChild: function() {

return this.child;

},

updateChild: function () {

var self = this;

self.child.childWidget("update", self);

}

});}(jQuery));

The child widget

(function ($) {

$.widget("ui.childWidget", $.ui.mouse, {

version: "@VERSION", widgetEventPrefix: "childWidget",

_create: function () {

},

childParent: function () {

return this.options.parent;

},

updatedParent: function() {

return this.newParent;

},

update: function(parent) {

var self = this;

self.newParent = parent;

}

});

}(jQuery));

Now to test my output I just create a parent retrieve the child and read its parent and updated parent and read them.

var parent = $("<div/>").parentWidget();

parent.parentWidget("updateChild");

var child = parent.parentWidget("getChild");

var childParent = child.childWidget("childParent");

var updatedParent = child.childWidget("updatedParent");

childParent.parentName or childParent.parentFeature() are undefined on ie7 and ie8 and works fine everywhere else

updatedParent possesses all its content.

Attachments (0)
Change History (4)

Changed January 16, 2013 12:59PM UTC by scottgonzalez comment:1

owner: → grathad
status: newpending

This seems unrelated to the widget factory. Is there a reason you think the bug is caused by jQuery UI code?

Changed January 17, 2013 12:19AM UTC by grathad comment:2

_comment0: Replying to [comment:1 scott.gonzalez]: \ > This seems unrelated to the widget factory. Is there a reason you think the bug is caused by jQuery UI code? \ That's true, I have the problem why using widgets in my code but the bug may come from jQuery "object" management, I didn't try further than the present bug sample. \ To be totally fair, I added this ticket because I felt guilty to ask for it in stack overflow and not here.1358382011808100
status: pendingnew

Replying to [comment:1 scott.gonzalez]:

This seems unrelated to the widget factory. Is there a reason you think the bug is caused by jQuery UI code?

That's true, I have the problem while using widgets in my code, but the bug may come from jQuery "object" management, I didn't try further than the present bug sample.

To be totally fair, I added this ticket because I felt guilty to ask for it in stack overflow and not here.

Changed January 28, 2013 02:02PM UTC by tj.vantoll comment:3

status: newpending

Changed February 12, 2013 08:55AM UTC by trac-o-bot comment:4

resolution: → invalid
status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!