Search
BaseForm.createButton Method
See Also
 






Creates a button with the specified options.

Namespace: MindFusion.Scheduling
File: BaseForm.js

 Syntax

JavaScript  Copy Code

function createButton (options)

 Parameters

options

Object. Object, containing data for the new control.

 Return Value

Object. The newly created button.

 Remarks

The options parameter should match the following pattern: { id: id, text: text, events: {"name": handler} }

 Example

The following code adds a new save button with a click event handler to a custom form. The custom form is represented by a class that extends BaseForm:

JavaScript  Copy Code

drawContent() {
  super.drawContent();

// create a text-area for the item subject
var btnSave = this.createButton({
   id: "btnSave",
  text: this.localInfo.saveButtonCaption,
  events: {
    "click": function click(e) {
     return thisObj.onSaveButtonClick(e);
    }
   }
  });
  btnSave.element.style.width = "200px";
  this.addControl(btnSave);
………..
}

 See Also