/* 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 { IntegralUIBaseService } from '../../integralui/components/integralui.core'; @Component({ selector: '', template: `

GroupBox / Events

{{groupObj.text}} Content

Event log:

  • {{ev.name}}{{ev.info}}

This sample presents all events that are fired from the GroupBox. Depending on action, a specific event is fired, which you can handle by creating an event handler.

The following events are supported:

  • afterCollapse - Occurs after group is collapsed
  • afterExpand - Occurs after group is expanded
  • afterSelect - Occurs after group is selected
  • beforeCollapse - Occurs before group is collapsed
  • beforeExpand - Occurs before group is expanded
  • beforeSelect - Occurs before group is selected
  • selectionChanged - Occurs when selected property has changed

Depending on some conditions, when handling some of above events you can prevent the default action to proceed, by canceling the operation. Event data has a cancel field, which when set to true will cancel the process.

For more information check out the source code of this sample (groupbox/groupbox-events.ts) file.

`, providers: [IntegralUIBaseService], encapsulation: ViewEncapsulation.None }) export class GroupBoxEventsSample { public groupObj: any = { text: 'Group' } public eventLog: Array = []; public ctrlStyle: any = { general: { normal: 'grbox-evt-normal' } } clearEventLog(){ this.eventLog.length = 0; } // Events onAfterCollapse(e: any){ this.eventLog.unshift({ name: "afterCollapse", info: " event was fired after group is collapsed." }); } onAfterExpand(e: any){ this.eventLog.unshift({ name: "afterExpand", info: " event was fired after group is expanded." }); } onAfterSelect(e: any){ this.eventLog.unshift({ name: "afterSelect", info: " event was fired after group is selected." }); } onBeforeCollapse(e: any){ this.eventLog.unshift({ name: "beforeCollapse", info: " event was fired before group is collapsed." }); } onBeforeExpand(e: any){ this.eventLog.unshift({ name: "beforeExpand", info: " event was fired before group is expanded." }); } onBeforeSelect(e: any){ this.eventLog.unshift({ name: "beforeSelect", info: " event was fired before group is selected." }); } onSelectedChanged(e: any){ this.eventLog.unshift({ name: "selectedChanged", info: " event was fired when selected property value has changed." }); } }