jQuery UI API Developer Guide

JQuery Add comments
SocialTwist Tell-a-Friend

jQuery UI is latest news at jQuery world. Current release supports 5 widgets (Accordion, Datepicker, Dialog, Slider, Tabs). jQuery give provision to create our own widget as per our need. Basic syntax to create our own widget

$.widget("ui.mywidget", { 
_init: function() {
// init code for mywidget
// can use this.options
if (this.options.hidden) {
// and this.element
this.element.hide();
}
},
_doSomething: function() {
// internal functions should be named begin with an underscore
// manipulate the widget
 },
value: function() {
// calculate some value and return it return
this._calculate();
},
length: function() {
return this._someOtherValue();
}
,
destroy: function() {
$.widget.prototype.apply(this, arguments); // default destroy
// now do other stuff particular to this widget
}
});

$.extend($.ui.mywidget, {
getter: "value length",
defaults: { option1: "defaultValue", hidden: true }
});

Tutorial for writing UI widgets

0 responses to “jQuery UI API Developer Guide ”

Leave a Reply

*** Please do not post spam. All comments require moderation,
So it may take some time to post to this blog! ***





Powered by Mango Blog. Design and Icons by N.Design Studio