5 ui.SplitButton = ui.AbstractWidget.extend({
10 _baseCls: "uiSplitButton",
11 init: function( parent ) {
12 this._super( parent );
14 this.button = new ui.Button({
15 label: this.config.label,
16 onclick: this._click_handler
18 this.menu = new ui.SelectMenuPanel({
19 value: this.config.value,
20 items: this._getItems(),
21 onSelect: this._select_handler
23 this.menuButton = new ui.MenuButton({
27 this.el = $.joey(this._main_template());
33 this.button.disable();
38 _click_handler: function() {
39 this.fire("click", this, { value: this.value } );
41 _select_handler: function( panel, event ) {
42 this.fire( "select", this, event );
44 _getItems: function() {
45 return this.config.items;
47 _main_template: function() {
48 return { tag: "DIV", cls: this._baseCls, children: [
49 this.button, this.menuButton
54 })( this.jQuery, this.app );