Search results

Dynamically move input to edit mode

At component 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.

import { Component, ViewChild } from '@angular/core';
import { InPlaceEditorComponent } from '@syncfusion/ej2-angular-inplace-editor';
import {  ChangeEventArgs } from '@syncfusion/ej2-buttons';

    selector: 'app-root',
    template: `
    <div id='container'>
    <table class="table-section">
            <td> EnableEditMode: </td>
                <ejs-checkbox id="enable" label="Enable" [checked]="true" (change)="onChange($event)"></ejs-checkbox>
            <td class="sample-td"> Enter your name: </td>
            <td class="sample-td">
                <ejs-inplaceeditor #element id="element" mode="Inline" value="Andrew" enableEditMode="true" actionOnBlur="Ignore" [model]="model"></ejs-inplaceeditor>

export class AppComponent {
    @ViewChild('element') editObj: InPlaceEditorComponent;
    public model: object = { placeholder: 'Enter some text' };
    public onChange(e: ChangeEventArgs): void {
        this.editObj.enableEditMode = e.checked;
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { InPlaceEditorAllModule } from '@syncfusion/ej2-angular-inplace-editor';
import { CheckBoxModule, ButtonModule } from '@syncfusion/ej2-angular-buttons';
import { AppComponent } from './app.component';

 * Module
    imports: [
        BrowserModule, InPlaceEditorAllModule, CheckBoxModule, ButtonModule
    declarations: [AppComponent],
    bootstrap: [AppComponent]
export class AppModule { }
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from '@angular/core';
import { AppModule } from './app.module';

<!DOCTYPE html>
<html lang="en">

    <title>Essential JS 2 InPlace Editor Sample</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Typescript InPlace Editor Controls" />
    <meta name="author" content="Syncfusion" />
    <link href="//" rel="stylesheet" />
    <link href="index.css" rel="stylesheet" />

    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
    <script src=""></script>
    <script src="systemjs.config.js"></script>
        <div id='loader'>LOADING....</div>
#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;