Search results

Add custom indication to unsaved value in React In-place Editor component

You can add custom indication to unsaved input value by using the actionSuccess event, when data not submitted to the server.

In this sample, the actionSuccess event configured and the URL property not included. Then submit button clicked, the current editor value saved into input and data sending to server action prevented due to the URL property not configured.

But actionSuccess event will trigger the handler function with null argument values. In handler function data property primaryKey value checked, whether it empty or not. If it is empty custom class, added in the e-value-wrapper element to customize its styles.

To send input value to local, set the URL property as empty.

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 {
            display: flex;
            justify-content: center;
            align-items: center;
            visibility: visible;
            height: 80px;

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

        #customtextbox {
            width: 150px;

        .content-title {
            font-weight: 500;
            margin-right: 20px;
            display: flex;
            align-items: center;

        #customtextbox.e-inplaceeditor .e-editable-value-wrapper .e-editable-value.e-send-error { /* csslint allow: adjoining-classes */
            color: red;
    <div id='root'>
        <div id='loader'>Loading....</div>
import { isNullOrUndefined as isNOU } from '@syncfusion/ej2-base';
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' };
    actionSuccess(e) {
        const keyVal = 'PrimaryKey';
        const primeKey =[keyVal];
        if (isNOU(primeKey) || primeKey === '') {
    render() {
        return (<div id='container'>
        <span className="content-title"> Enter your name: </span>
        <InPlaceEditorComponent id='customtextbox' mode='Inline' value='Andrew' model={this.model} actionSuccess={this.actionSuccess = this.actionSuccess.bind(this)}/>
export default App;