hour20_12

Creating Custom Widgets

hour20_exercise_01

Refresh Page

$.widget("custom.mywidget",{

options :{

})

// custom options

},

create: function(){

//creation code

},

refresh: function(){

//refress code called when element refreshed

},

destroy: function(){

//cleanup code called when widget is destroyed

},

setOptions: function(){

// _super and _superApply handle keeping the right this-context

this.superApply(arguments);

this._refresh();

},

setOption: function( key, value){

// set individual option value override code

this._super(key, value);

}

});