Last active
August 29, 2015 14:05
-
-
Save alexanderbartels/5ea6ffdb91f5501e6687 to your computer and use it in GitHub Desktop.
overview of extending jQuery UI widgets in 1.8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($, _super){ | |
$.widget('bartels.myDialog', $.ui.dialog, { | |
options: { | |
someKey: undefined | |
}, | |
_create: function () { | |
_super._create.call(this); | |
this.updateSomeKey(this.options.someKey); | |
}, | |
open: function () { | |
console.log("Open dialog"); | |
return _super.open.apply(this, arguments); | |
}, | |
updateSomeKey: function (value) { | |
console.log("Update someKey: ", value); | |
}, | |
_setOption: function( key, value ) { | |
switch( key ) { | |
case "someKey": | |
this.updateSomeKey(someKey); | |
break; | |
} | |
_super._setOption.apply( this, arguments ); | |
}, | |
destroy: function() { | |
_super.destroy.call(this); | |
} | |
}); | |
})(jQuery, jQuery.ui.dialog.prototype); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment