Search results

InPlaceEditorComponent

InPlaceEditor represents the react InPlaceEditor.

<InPlaceEditor />

Properties

actionOnBlur

string

Specifies the action to be perform when user clicks outside the container, that is focus out of editable content. The possible options are,

  • Cancel: Cancel’s the editing and resets the old content.
  • Submit: Submit the edited content to the server.
  • Ignore: No action is perform with this type and allows to have many containers open.

Defaults to ‘Submit’

adaptor

string

Specifies the adaptor type that are used DataManager to communicate with DataSource. The possible values are,

  • UrlAdaptor: Base adaptor for interacting with remote data services.
  • ODataV4Adaptor: Used to interact with ODataV4 service.
  • WebApiAdaptor: Used to interact with Web api created with OData endpoint.
import { render } from 'react-dom';
import * as React from 'react';
import { InPlaceEditorComponent } from '@syncfusion/ej2-react-inplace-editor';
import { SampleBase } from './sample-base';

export class Default extends SampleBase<{}, {}> {

     private adaptor: string = 'UrlAdaptor';

    render() {
        return (
            <InPlaceEditorComponent  adaptor={this.adaptor}>
            </InPlaceEditorComponent>
        );
    }
}

Defaults to ‘UrlAdaptor’

cancelButton

ButtonModel

Used to customize the “Cancel” button UI appearance by defining Button model configuration.

import { render } from 'react-dom';
import * as React from 'react';
import { InPlaceEditorComponent } from '@syncfusion/ej2-react-inplace-editor';
import { SampleBase } from './sample-base';
import {ButtonModel } from '@syncfusion/ej2-buttons';

export class Default extends SampleBase<{}, {}> {

      private cancelButton: ButtonModel = { content: 'Cancel', cssClass: 'e-outline'};

    render() {
        return (
            <InPlaceEditorComponent  cancelButton={this.cancelButton}>
            </InPlaceEditorComponent>
        );
    }
}

Defaults to { iconCss: ‘e-icons e-cancel-icon’ }

cssClass

string

Defines single/multiple classes (separated by space) to be used for customization of In-place editor.

Defaults to

disabled

boolean

Specifies whether to enable editing mode or not.

Defaults to false

editableOn

string

Specifies the event action of input to enter edit mode instead of using edit icon. The possible values are:

  • Click: Do the single click action on input to enter into the edit mode.
  • DblClick: Do the single double click action on input to enter into the edit mode.
  • EditIconClick: Disables the editing of event action of input and allows user to edit only through edit icon.
import { render } from 'react-dom';
import * as React from 'react';
import { InPlaceEditorComponent } from '@syncfusion/ej2-react-inplace-editor';
import { SampleBase } from './sample-base';

export class Default extends SampleBase<{}, {}> {

    private editableOn: string = 'DblClick';

    render() {
        return (
            <InPlaceEditorComponent  editableOn={this.editableOn}>
            </InPlaceEditorComponent>
        );
    }
}

Defaults to ‘Click’

emptyText

string

Sets the text to be shown when an element has ‘Empty’ value.

import { render } from 'react-dom';
import * as React from 'react';
import { InPlaceEditorComponent } from '@syncfusion/ej2-react-inplace-editor';
import { SampleBase } from './sample-base';

export class Default extends SampleBase<{}, {}> {

    private emptyText: string = 'text';

    render() {
        return (
            <InPlaceEditorComponent  emptyText={this.emptyText}>
            </InPlaceEditorComponent>
        );
    }
}

Defaults to ‘Empty’

enableEditMode

boolean

Specifies to show/hide the editing mode.

import { render } from 'react-dom';
import * as React from 'react';
import { InPlaceEditorComponent } from '@syncfusion/ej2-react-inplace-editor';
import { SampleBase } from './sample-base';

export class Default extends SampleBase<{}, {}> {

     private enableEditMode: boolean = true;

    render() {
        return (
            <InPlaceEditorComponent  enableEditMode={this.enableEditMode}>
            </InPlaceEditorComponent>
        );
    }
}

Defaults to false

enableHtmlSanitizer

boolean

Defines whether to allow the cross-scripting site or not.

Defaults to true

enablePersistence

boolean

Enable or disable persisting component’s state between page reloads. If enabled, following list of states will be persisted.

  1. value

import { render } from ‘react-dom’; import * as React from ‘react’; import { InPlaceEditorComponent } from ‘@syncfusion/ej2-react-inplace-editor’; import { SampleBase } from ‘./sample-base’;

export class Default extends SampleBase<{}, {}> {

private enablePersistence: boolean = true;

render() {
    return (
        <InPlaceEditorComponent  enablePersistence={this.enablePersistence}>
        </InPlaceEditorComponent>
    );
}

}

Defaults to *false*

<h3 class="doc-prop-wrapper" id="enablertl" data-Path="enablertl-enableRtl">
<a href="#enablertl" aria-hidden="true" class="anchor">
<svg aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 
3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 
4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 
1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z">
</path>
</svg>
</a><span class='doc-prop-name'>enableRtl</span>

<span class="doc-prop-type"> `boolean`
</span>

</h3>


Enable or disable rendering component in right to left direction.

Defaults to *false*

<h3 class="doc-prop-wrapper" id="locale" data-Path="locale-locale">
<a href="#locale" aria-hidden="true" class="anchor">
<svg aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 
3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 
4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 
1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z">
</path>
</svg>
</a><span class='doc-prop-name'>locale</span>

<span class="doc-prop-type"> `string`
</span>

</h3>


Overrides the global culture and localization value for this component. Default global culture is 'en-US'.

Defaults to *''*

<h3 class="doc-prop-wrapper" id="mode" data-Path="mode-mode">
<a href="#mode" aria-hidden="true" class="anchor">
<svg aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 
3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 
4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 
1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z">
</path>
</svg>
</a><span class='doc-prop-name'>mode</span>

<span class="doc-prop-type"> `string`
</span>

</h3>


Specifies the mode to be render while editing. The possible modes are :
- `Inline`: Editable content is displayed as inline text and ok/cancel buttons are displayed at right bottom corner of input.
- `Popup`: Editable content and ok/cancel buttons are displayed inside popup while editing.

```tsx

import { render } from 'react-dom';
import * as React from 'react';
import { InPlaceEditorComponent } from '@syncfusion/ej2-react-inplace-editor';
import { SampleBase } from './sample-base';

export class Default extends SampleBase<{}, {}> {

     private mode: string = 'Inline';

    render() {
        return (
            <InPlaceEditorComponent  mode={this.mode}>
            </InPlaceEditorComponent>
        );
    }
}

Defaults to ‘Popup’

model

AutoCompleteModel | ColorPickerModel | ComboBoxModel | DatePickerModel | DateRangePickerModel | DateTimePickerModel | DropDownListModel | MaskedTextBoxModel | MultiSelectModel | NumericTextBoxModel | RichTextEditorModel | SliderModel | TextBoxModel | TimePickerModel

Specifies the model object configuration for the integrated components like AutoComplete, DatePicker,NumericTextBox, etc.

import { render } from 'react-dom';
import * as React from 'react';
import { InPlaceEditorComponent } from '@syncfusion/ej2-react-inplace-editor';
import { SampleBase } from './sample-base';
import {TextBoxModel } from '@syncfusion/ej2-inputs';

export class Default extends SampleBase<{}, {}> {

    private model : TextBoxModel  = { placeholder: "Enter employee name" }
    private type : string  ='Text';

    render() {
        return (
            <InPlaceEditorComponent  model={this.model} type={this.type}>
            </InPlaceEditorComponent>
        );
    }
}

Defaults to null

name

string

  • Specifies the name of the field which is used to map data to the server. If name is not given, then component ID is taken as mapping field name.

import { render } from ‘react-dom’; import * as React from ‘react’; import { InPlaceEditorComponent } from ‘@syncfusion/ej2-react-inplace-editor’; import { SampleBase } from ‘./sample-base’;

export class Default extends SampleBase<{}, {}> {

private name: string = 'Editor';

render() {
    return (
        <InPlaceEditorComponent  name={this.name}>
        </InPlaceEditorComponent>
    );
}

}

Defaults to *''*

<h3 class="doc-prop-wrapper" id="popupsettings" data-Path="popupsettings-popupSettings">
<a href="#popupsettings" aria-hidden="true" class="anchor">
<svg aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16">
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 
3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 
4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 
1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z">
</path>
</svg>
</a><span class='doc-prop-name'>popupSettings</span>

<span class="doc-prop-type"> [`PopupSettingsModel`](./popupSettingsModel)
</span>

</h3>


Specifies the object to customize popup display settings like positions, animation etc.
```tsx

import { render } from 'react-dom';
import * as React from 'react';
import { InPlaceEditorComponent } from '@syncfusion/ej2-react-inplace-editor';
import { SampleBase } from './sample-base';
import { PopupSettingsModel } from "@syncfusion/ej2-inplace-editor/src/inplace-editor/base/models-model";

export class Default extends SampleBase<{}, {}> {

    private popupSettings: PopupSettingsModel = {
    model: { width: "auto" }
  };

    render() {
        return (
            <InPlaceEditorComponent  popupSettings={this.popupSettings}>
            </InPlaceEditorComponent>
        );
    }
}

Defaults to {}

primaryKey

string | number

Defines the unique primary key of editable field which can be used for saving data in data-base.

import { render } from 'react-dom';
import * as React from 'react';
import { InPlaceEditorComponent } from '@syncfusion/ej2-react-inplace-editor';
import { SampleBase } from './sample-base';

export class Default extends SampleBase<{}, {}> {

     private primaryKey: string = '';

    render() {
        return (
            <InPlaceEditorComponent  primaryKey={this.primaryKey}>
            </InPlaceEditorComponent>
        );
    }
}

Defaults to

saveButton

ButtonModel

Used to customize the “Save” button UI appearance by defining Button model configuration.

import { render } from 'react-dom';
import * as React from 'react';
import { InPlaceEditorComponent } from '@syncfusion/ej2-react-inplace-editor';
import { SampleBase } from './sample-base';
import {ButtonModel } from '@syncfusion/ej2-buttons';

export class Default extends SampleBase<{}, {}> {

     private saveButton: ButtonModel = { content: 'OK', cssClass: 'e-outline'};

    render() {
        return (
            <InPlaceEditorComponent  saveButton={this.saveButton}>
            </InPlaceEditorComponent>
        );
    }
}

Defaults to { iconCss: ‘e-icons e-save-icon’ }

showButtons

boolean

Used to show/hide the ok/cancel buttons of In-place editor.

import { render } from 'react-dom';
import * as React from 'react';
import { InPlaceEditorComponent } from '@syncfusion/ej2-react-inplace-editor';
import { SampleBase } from './sample-base';

export class Default extends SampleBase<{}, {}> {

     private showButtons: boolean = true;

    render() {
        return (
            <InPlaceEditorComponent  showButtons={this.showButtons}>
            </InPlaceEditorComponent>
        );
    }
}

Defaults to true

submitOnEnter

boolean

Sets to trigger the submit action with enter key pressing of input.

import { render } from 'react-dom';
import * as React from 'react';
import { InPlaceEditorComponent } from '@syncfusion/ej2-react-inplace-editor';
import { SampleBase } from './sample-base';

export class Default extends SampleBase<{}, {}> {

    private submitOnEnter: boolean =true;

    render() {
        return (
            <InPlaceEditorComponent  submitOnEnter={this.submitOnEnter}>
            </InPlaceEditorComponent>
        );
    }
}

Defaults to true

template

string | HTMLElement

Specifies the HTML element ID as a string that can be added as a editable field.

import { render } from 'react-dom';
import * as React from 'react';
import { InPlaceEditorComponent } from '@syncfusion/ej2-react-inplace-editor';
import { SampleBase } from './sample-base';

export class Default extends SampleBase<{}, {}> {

     private template: string = '<p> Editor</p>';

    render() {
        return (
            <InPlaceEditorComponent  template={this.template}>
            </InPlaceEditorComponent>
        );
    }
}

Defaults to

textOption

string

Specifies the option to be set on initial rendering. It is applicable for DropDownList, AutoComplete, ComboBox, and MultiSelect component types. The possible options are:

  • Never: The corresponding field value will never be set initially in the component.
  • Always: The corresponding field value will be set initially in the component.

Defaults to ‘Never’

type

string

Specifies the type of components that integrated with In-place editor to make it as editable.

import { render } from 'react-dom';
import * as React from 'react';
import { InPlaceEditorComponent } from '@syncfusion/ej2-react-inplace-editor';
import { SampleBase } from './sample-base';

export class Default extends SampleBase<{}, {}> {

     private type: string = 'Inline';

    render() {
        return (
            <InPlaceEditorComponent  type={this.type}>
            </InPlaceEditorComponent>
        );
    }
}

Defaults to ‘Text’

url

string

Gets the url for server submit action.

import { render } from 'react-dom';
import * as React from 'react';
import { InPlaceEditorComponent } from '@syncfusion/ej2-react-inplace-editor';
import { SampleBase } from './sample-base';

export class Default extends SampleBase<{}, {}> {

    private url: string = 'https://ej2services.syncfusion.com/production/web-services/api/Editor/UpdateData';

    render() {
        return (
            <InPlaceEditorComponent  url={this.url}>
            </InPlaceEditorComponent>
        );
    }
}

Defaults to

validationRules

Object

Maps the validation rules for the input.

import { render } from 'react-dom';
import * as React from 'react';
import { InPlaceEditorComponent } from '@syncfusion/ej2-react-inplace-editor';
import { SampleBase } from './sample-base';

export class Default extends SampleBase<{}, {}> {

     private name: string = 'Today';

   private validationRules =  {
        Today: { required: true }

    render() {
        return (
            <InPlaceEditorComponent  name={this.name} validationRules={this.validationRules}>
            </InPlaceEditorComponent>
        );
    }
}

Defaults to null

value

string | number | Date | string[] | Date[] | number[]

Specifies the display value for input when original input value is empty.

import { render } from 'react-dom';
import * as React from 'react';
import { InPlaceEditorComponent } from '@syncfusion/ej2-react-inplace-editor';
import { SampleBase } from './sample-base';

export class Default extends SampleBase<{}, {}> {

     private value: string = 'Editor';

    render() {
        return (
            <InPlaceEditorComponent  value={this.value}>
            </InPlaceEditorComponent>
        );
    }
}

Defaults to null

Methods

destroy

Removes the control from the DOM and also removes all its related events.

Returns void

save

Submit the edited input value to the server.

Returns void

validate

Validate current editor value.

Returns void

Events

actionBegin

EmitType<ActionBeginEventArgs>

The event will be fired before the data submitted to the server.

actionFailure

EmitType<ActionEventArgs>

The event will be fired when data submission failed.

actionSuccess

EmitType<ActionEventArgs>

The event will be fired when data submitted successfully to the server.

beforeSanitizeHtml

EmitType<BeforeSanitizeHtmlArgs>

Event triggers before sanitize the value.

beginEdit

EmitType<BeginEditEventArgs>

The event will be fired before changing the mode from default to edit mode.

cancelClick

EmitType<MouseEvent>

Event triggers when click the cancel button.

change

EmitType<ChangeEventArgs>

The event will be fired when the integrated component value has changed that render based on the type property in the In-place editor.

created

EmitType<Event>

The event will be fired once the component rendering is completed.

destroyed

EmitType<Event>

The event will be fired when the component gets destroyed.

submitClick

EmitType<MouseEvent>

Event triggers when click the submit button.

validating

EmitType<ValidateEventArgs>

The event will be fired while validating current value.