Dynamic edit mode in EJ2 JavaScript In place editor control

19 Apr 20234 minutes to read

At control initial load, if you want to open editor state without interacting In-place Editor input element, it can be achieved by configuring the enableEditMode property to true.

In the following sample, editor opened at initial load and when toggling a checkbox, it will remove or open the editor.


var CheckBoxObj = new ej.buttons.CheckBox({ label: 'Enable Editor', checked: true, change: onChange });

//Initialize In-place Editor control
var editObj = new ej.inplaceeditor.InPlaceEditor({
    mode: 'Inline',
    value: 'Andrew',
    enableEditMode: true,
    actionOnBlur: 'Ignore',
    model: {
        placeholder: 'Enter some text'

//Render initialized In-place Editor control

function onChange(e) {
    editObj.enableEditMode = e.checked;
<!DOCTYPE html><html lang="en"><head>
    <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="https://cdn.syncfusion.com/ej2/26.2.4/material.css" rel="stylesheet">
    <link href="index.css" rel="stylesheet">
<script src="https://cdn.syncfusion.com/ej2/26.2.4/dist/ej2.min.js" type="text/javascript"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>

    <div id="container">
        <table class="table-section">
                <td> EnableEditMode: </td>
                    <input id="enable" type="checkbox">
                <td class="sample-td"> Enter your name: </td>
                <td class="sample-td">
                    <div id="element"></div>

var ele = document.getElementById('container');
if(ele) {
  ele.style.visibility = "visible";
<script src="index.js" type="text/javascript"></script>