/* 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, enableProdMode, ViewContainerRef, ViewChild, ViewChildren, ViewEncapsulation } from '@angular/core'; import { IntegralUICommonService } from '../../integralui/services/integralui.common.service'; import { IntegralUITreeGrid } from '../../integralui/components/integralui.treegrid'; enableProdMode(); @Component({ selector: 'iui-app', template: `
To populate the TreeGrid component with data, you can either load data on demand from local or remote data source or add new rows dynamically when required. In order to create a new row manually, you can use some of public methods available that allows you to insert a row at specific position in the treegrid. This sample demonstrates how to add new rows on demand and how to create and use a custom cell editor.
To add a new row use the button above the treegrid. Whenever the add button is clicked, a new row is created at first position in the treegrid and an inline cell editor appears. The cells in the last column contain action buttons that confirm or cancel the change of cell values.
After row is created, you can easily edit its cell values by clicking on edit action button (represented by pencil icon). In addition, you can remove rows by clicking on remove action button (represented by delete icon).
For more information check out the source code of this sample (treegrid/treegrid-add-row-dynamically.ts) file.