Search
BaseForm.drawButtons Method
See Also
 






Renders the form buttons.

Namespace: MindFusion.Scheduling
File: BaseForm.js

 Syntax

JavaScript  Copy Code

function drawButtons ()

 Remarks

Override this method in a derived class to render custom form buttons.

 Example

The following code overrides the drawButtons method to render two buttons to a custom form. The custom form is represented by a class that extends BaseForm:

JavaScript  Copy Code

// override BaseForm's drawButtons method to create form buttons
 drawButtons() {
  var thisObj = this;

  var btnSave = this.createButton({
   id: "btnSave",
   text: this.localInfo.saveButtonCaption,
   events: {
    "click": function click(e) {
     return thisObj.onSaveButtonClick(e);
    }
   }
  });

  var btnCancel = this.createButton({
   id: "btnCancel",
   text: this.localInfo.cancelButtonCaption,
   events: {
    click: function click(e) {
     return thisObj.onCancelButtonClick(e);
    }
   }
  });

  var buttons = this.row();
  buttons.classList.add("mfp-buttons-row");
  buttons.appendChild(btnSave.element);
  buttons.appendChild(btnCancel.element);

  return buttons;
 }

 See Also