/* Copyright © 2016-2019 Lidor Systems. All rights reserved. This file is part of the "IntegralUI Web" Library. The contents of this file are subject to the IntegralUI Web License, and may not be used except in compliance with the License. A copy of the License should have been installed in the product's root installation directory or it can be found at http://www.lidorsystems.com/products/web/studio/license-agreement.aspx. This SOFTWARE is provided "AS IS", WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. Any infringement will be prosecuted under applicable laws. */ import { Component, ViewContainerRef, ViewChild, ViewEncapsulation } from '@angular/core'; import { IntegralUIEditorType } from '../../integralui/components/integralui.core'; import { IntegralUIGrid } from '../../integralui/components/integralui.grid'; @Component({ selector: '', template: `
An example of Grid component where you can edit the label of grid cells using a built-in text editor. Whenever a cell is clicked, a textbox will popup where you can enter a new string and change the cell label. The editor is fully customizable via CSS.
In above demo, cells in Company column are editable. When you click on the cell, a textbox will popup where you can enter a new string. To confirm the change press the ENTER key, this will close the editor and apply the new string to the cell. If you click outside the cell or press the ESCAPE key, the editor will close and the change is cancelled.
To enable the text editor, in column object you need to set the following fields:
When editor is set in this way, all cells that belong to specified column will display a text box. You can modify this by changing the editor visibility in the cell object using the editorSettings field. In addition, you can also set whether the editor is enabled or disabled. The cell object has the following editorSettings fields:
For more information check out the source code of this sample (grid/grid-edit-cell-text.ts) file.