I am using the jqueryUI factory widget to extend the jqUI dialog widget. I installed the simplest widget that I can think of. He does nothing, just inherits the dialogue. However, I could not get it to work.
I have a fiddle demonstrating this here: View Fiddle
Here's the test markup:
<div id="a">hello</div> <div id="b">bye</div>
Here's the javascript:
(function ($, undefined) { var o = //Widget prototype { options: {}, _create: function () {}, destroy: function () { $.Widget.prototype.destroy.call(this); }, _setOption: function (key, value) { $.Widget.prototype._setOption.apply(this, arguments); }, }; //Run jQuery widget factory to create the widget $.widget('cs.csDialog', $.ui.dialog, o); } (jQuery)); //Test it out $("#a").dialog(); //Works $("#b").csDialog(); //Fails
Inside jqUI, the following error appears: this.uiDialog undefined
I do not see what I did wrong. I would really appreciate any help. Thanks.
source share