/* 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, ViewChildren, ViewEncapsulation } from '@angular/core'; import { IntegralUISelectionMode } from '../../integralui/components/integralui.core'; @Component({ selector: '', template: `
In this sample you can edit item label in TreeView component, by left-click on its label.
When item is clicked, the text editor will not appear immediately. You need to press and hold the left-mouse button for a short amount of time (250ms) and then release it, after which the text editor will appear.
To confirm any changes in the editor, press the ENTER key. If you press the ESCAPE key or click anywhere outside of the editor, editing is cancelled.
Furthermore, some items have allowEdit field set to false. This prevents the text editor to appear for these items. For example, the 'Favorites' and 'Documents' items are non editable.
For more information check out the source code of this sample (treeview/treeview-editing.ts) file, or read the following article: