Button

Description

The button component is defined in divmanazer bundle and provides a generic button ui element.

How to use

Creates a button with label "Alert" and binds a handler to it that shows an alert when clicked.

var alertBtn = Oskari.clazz.create('Oskari.userinterface.component.Button');

// make visually "primary" button (blue)
alertBtn.addClass('primary');
alertBtn.setTitle('Alert');
alertBtn.setHandler(function() {
    alert('Alert');
});

Inserts the button to given element.

var myUI = jQuery('div.mybundle.buttons');

alertBtn.insertTo(myUI);

Remove the button.

alertBtn.destroy();

Set focus the button.

alertBtn.focus();

Set blur the button.

alertBtn.blur();

Last modified: Fri Mar 15 2024 14:11:33 GMT+0200 (Eastern European Standard Time)