ludo.form.Button

ludo.form.


new ludo.form.Button(config)

TODO specify which form the button belongs to. used for disableOnInvalid
Button component
The button class extends ludo.form.Element

Parameters:
Name Type Description
config Object
Properties
Name Type Description
submittable Boolean

Default: false. When false, the JSON from parentView.getForm().values() will not not include the button.

disabled Boolean

Default: false. True to initially disable the button

selected Boolean

True to set the button initial selected.

toggle Boolean

When true, the button will remain in it's pressed until a new press on button occurs.

toggleGroup String | Object

Used for toggling between buttons. Example: { type:'form.Button', toggle:true, toggleGroup:'myGroup',value:'1' },
{ type:'form.Button', toggle:true, toggleGroup:'myGroup',value:'2' }. Here, two buttons are assigned to the same toggleGroup 'myGroup'. When one button is pressed,
the other button will be unpressed.

disableOnInvalid Boolean

True to automatically disable button when parent form is invalid.

size String

Size of button's','m','l' (small, medium or large)

formRef String

Id of parent view. disableOnInvalid will be triggred when the form of this view is invalid.

listeners String

Event listeners. Example:

listeners: {
'click': function() { }
}

icon String

Path to icon image placed left to button text.

iconPressed String

Path to icon image displayed when button is pressed.

Source:
Fires:
  • ludo.form.Button#click Fired on click. Arguments: 1) valud, 2) ludo.form.event:Button

Methods


click() → {undefined|Boolean}

Trigger click on button

Source:
Returns:
Type
undefined | Boolean

getToggleGroup() → {Object}

Return instance of ludo.form.ToggleGroup

Source:
Returns:

ludo.form.ToggleGroup

Type
Object