Search results

Buttons in JavaScript In-place Editor control

08 May 2023 / 2 minutes to read

The In-place Editor had an action for save and cancel using buttons. The saveButton and cancelButton properties accept the ButtonModel objects for customizing the save and cancel button properties.

Buttons can be show or hide by sets a Boolean value to the showButtons property.

Without buttons value will be processed via the following ways.

  • actionOnBlur: By clicking out side the editor control get focus out and do action based on this property value.
  • submitOnEnter: Pressing Enter key it performs the submit action, if this property set to true.

In the following sample, the content and cssClass properties of Button value assigned to the saveButton and cancelButton properties to customize its appearance. Also check or uncheck a checkbox buttons render or removed from the editor.

To restrict either save or cancel button rendering into a DOM, simply pass empty object {} in the saveButton or cancelButton properties.

For more details about buttons, refer this documentation section.

Copied to clipboard
import { InPlaceEditor, ActionBlur } from '@syncfusion/ej2-inplace-editor';
import { CheckBox, ChangeEventArgs } from '@syncfusion/ej2-buttons';

let CheckBoxObj: CheckBox = new CheckBox({ label: 'Show', checked: true, change: onChange });

let editObj: InPlaceEditor = new InPlaceEditor({
mode: 'Inline',
value: 'Andrew',
model: {
    placeholder: 'Enter some text'
saveButton: {
    content: 'Ok',
    cssClass: 'e-outline'
cancelButton: {
    content: 'Cancel',
    cssClass: 'e-outline'

function onChange(e: ChangeEventArgs): void {
editObj.showButtons = e.checked;
Copied to clipboard
<!DOCTYPE html>
<html lang="en">

    <title>Essential JS 2 In-place Editor</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript In-place Editor Control" />
    <meta name="author" content="Syncfusion" />
    <link href="//" rel="stylesheet" />
    <link href="index.css" rel="stylesheet" />
    <script src=""></script>
    <script src="systemjs.config.js"></script>

    <div id='loader'>LOADING....</div>
    <div id='container'>
        <table class="table-section">
                <td> ShowButtons: </td>
                    <input id="enableBtn" type="checkbox">
                <td  class="sample-td"> Enter your name: </td>
                <td  class="sample-td">
                    <div id="element"></div>


See Also