Search results

Buttons in React In-place Editor component

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

Buttons can be show or hide by setting a boolean value to the showButtons property.

Without buttons value actions will be performed by the following way.

  • actionOnBlur: By clicking out-side of the editor component it will get focus out and perform action based on this property value.
  • submitOnEnter: Pressing Enter key it performs the submit action, when 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.

import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App  from './App';

ReactDOM.render(<App />, document.getElementById('root'));
<!DOCTYPE html>
<html lang="en">

    <title>Essential JS 2 React In-place Editor Sample</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Essential JS 2 for React Components" />
    <meta name="author" content="Syncfusion" />
    <link href="//" rel="stylesheet" />
    <script src=""></script>
    <script src="systemjs.config.js"></script>
        #container {
            visibility: visible;

        #loader {
            color: #008cff;
            height: 40px;
            left: 45%;
            position: absolute;
            top: 45%;
            width: 30%;

        .table-section {
            margin: 0 auto;

        tr td:first-child {
            text-align: right;
            padding-right: 20px;

        .sample-td {
            padding-top: 10px;
            min-width: 230px;
            height: 100px;
    <div id='root'>
        <div id='loader'>Loading....</div>
import { CheckBoxComponent } from '@syncfusion/ej2-react-buttons';
import { InPlaceEditorComponent } from '@syncfusion/ej2-react-inplace-editor';
import * as React from "react";
import './App.css';
class App extends React.Component {
    constructor() {
        this.model = { placeholder: 'Enter some text' };
        this.saveButton = { content: 'Ok', cssClass: 'e-outline' };
        this.cancelButton = { content: 'Cancel', cssClass: 'e-outline' };
    onChange(e) {
        this.inplaceEditorObj.showButtons = e.checked;
    render() {
        return (<div id='container'>
         <table className="table-section">
                <td> ShowButtons: </td>
                    <CheckBoxComponent id='enableBtn' checked={true} label='Show' change={this.onChange = this.onChange.bind(this)}/>
                 <td className="sample-td"> Enter your name: </td>
                 <td className="sample-td">
                    <InPlaceEditorComponent ref={(text) => { this.inplaceEditorObj = text; }} id='element' mode='Inline' value='Andrew' model={this.model} saveButton={this.saveButton} cancelButton={this.cancelButton}/>
export default App;

See Also