File

src/demo-app/app/app.component.ts

Extends

DevextremeDatagrid

Implements

OnInit

Metadata

selector cause-demo
styleUrls app.component.styl
templateUrl ./app.component.html

Constructor

constructor(dialog: DialogsService, http: HttpService, windowRef: WindowRefService, language: LanguageService)

Methods

ngOnInit
ngOnInit()
Returns : void
Public onTestDialogConfirm
onTestDialogConfirm()
Returns : void
Public onTestDialogFullscreen
onTestDialogFullscreen()
Returns : void
Public onTestDialogWait
onTestDialogWait()
Returns : void
Public onTestHttpService
onTestHttpService()
Returns : void
Public onTestWindowReference
onTestWindowReference()
Returns : void
Public onDatagridUpdated
onDatagridUpdated()
Returns : void
Public onDatagridRemoved
onDatagridRemoved()
Returns : void

Properties

Public infos
infos:
import { Component, OnInit } from '@angular/core';

import {LanguageService} from 'igo2';

import {
  DevextremeDatagrid,
  DialogsService,
  HttpService,
  WindowRefService,
} from '../../lib';
import '../../lib/core/extends/devextreme-fr';

@Component({
  selector: 'cause-demo',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.styl']
})
export class AppComponent extends DevextremeDatagrid implements OnInit {
  public infos = [
    {name: {'fr': 'test 1'}},
    {name: {'fr': 'test 2'}}
  ];

  constructor(
    private dialog?: DialogsService,
    private http?: HttpService,
    private windowRef?: WindowRefService,
    private language?: LanguageService
  ) {
    super();

    this.language.setLanguage('fr');
  }

  ngOnInit() {
  }

  public onTestDialogConfirm() {
    this.dialog.confirm('Test confirm', 'Question oui/non');
  }

  public onTestDialogFullscreen() {
    this.dialog.fullscreen('Test fullscreen', 'Avec du contenu plein écran');
  }

  public onTestDialogWait() {
    this.dialog.wait();
  }

  public onTestHttpService() {
    this.http.get('assets/cause/locale/en.json').subscribe(data => {
      alert('requête terminé');
    });
  }

  public onTestWindowReference() {
    console.log(this.windowRef.nativeObject('navigator'));
  }

  public onDatagridUpdated() {
    console.log('updated');
  }

  public onDatagridRemoved() {
    console.log('removed');
  }
}
<cause-request-loader></cause-request-loader>
<h1>Demo cause-lib/angular-lib</h1>
<md-card>
  <md-card-title>{{'dialog' | translate}}</md-card-title>
  <md-card-content>
    <button md-button (click)="onTestDialogConfirm()">{{'confirm' | translate}}</button>
    <button md-button (click)="onTestDialogFullscreen()">{{'fullscreen' | translate}}</button>
    <button md-button (click)="onTestDialogWait()">{{'wait' | translate}}</button>
  </md-card-content>
</md-card>
<br />
<md-card>
  <md-card-title>{{'httpService' | translate}}</md-card-title>
  <md-card-content>
    <button id="http-service" md-button (click)="onTestHttpService()">TEST</button>
  </md-card-content>
</md-card>
<br />
<md-card>
  <md-card-title>{{'languageDevextreme' | translate}}</md-card-title>
  <md-card-content>
    <dx-data-grid
            [dataSource]="infos"
            [hoverStateEnabled]="true"
            (onRowUpdated)="onDatagridUpdated($event)"
            (onRowRemoved)="onDatagridRemoved($event)">
      <dxi-column
              dataField="name"
              caption="{{'name' | translate}}"
              [calculateCellValue]="onCalculateCellValue">
      </dxi-column>
      <dxo-filter-row [visible]="true"></dxo-filter-row>
      <dxo-editing mode="row" [allowUpdating]="true" [allowDeleting]="true"></dxo-editing>
    </dx-data-grid>
  </md-card-content>
</md-card>
<br />
<md-card>
  <md-card-title>{{'multilangComponent' | translate}}</md-card-title>
  <md-card-content>
    <cause-multilang></cause-multilang>
  </md-card-content>
</md-card>
<br />
<md-card>
  <md-card-title>{{'takepictureComponent' | translate}}</md-card-title>
  <md-card-content>
    <cause-takepicture></cause-takepicture>
  </md-card-content>
</md-card>
<br />
<md-card>
  <md-card-title>{{'windowReference' | translate}}</md-card-title>
  <md-card-content>
    <button id="window-reference" md-button (click)="onTestWindowReference()">TEST</button>
  </md-card-content>
</md-card>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""