Search results

Dynamically move input to edit mode in JavaScript In-place Editor control

23 Mar 2023 / 1 minute 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.

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

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

let editObj: InPlaceEditor = new InPlaceEditor({
    mode: 'Inline',
    value: 'Andrew',
    enableEditMode: true,
    actionOnBlur: 'Ignore'
    model: {
        placeholder: 'Enter some text'

function onChange(e: ChangeEventArgs): void {
    editObj.enableEditMode = 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> EnableEditMode: </td>
                    <input id="enable" type="checkbox">
                <td class="sample-td"> Enter your name: </td>
                <td class="sample-td">
                    <div id="element"></div>