Disable edit mode in EJ2 TypeScript In place editor control

19 Apr 20233 minutes to read

The edit mode of In-place Editor can be disabled by setting the disabled property value to true. In the following sample, when check or uncheck the checkbox, In-place Editor control will disable or enable the edit mode.

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

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

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

function onChange(e: ChangeEventArgs): void {
    editObj.disabled = e.checked;
<!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="https://cdn.syncfusion.com/ej2/24.2.3/material.css" rel="stylesheet" />
    <link href="index.css" rel="stylesheet" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.38/system.js"></script>
    <script src="systemjs.config.js"></script>
<script src="https://cdn.syncfusion.com/ej2/syncfusion-helper.js" type ="text/javascript"></script>

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