|
<ej-grid id="Grid" [dataSource]="data" [allowPaging]="true" [toolbarSettings]="toolbarItems" [editSettings]="editSettings"
[allowSorting]="true" >
<e-columns>
<e-column headerText="Photo" width="90">
<ng-template e-template let-data>
<div>
<button (click)="clicked($event, data.OrderID)">...</button>
</div>
</ng-template>
</e-column>
<e-column field="OrderID" headerText="OrderID" [isPrimaryKey]="true" width="75"></e-column>
--------------------------
</e-columns>
</ej-grid>
-------------------------------------------
export class AppComponent {
public gridData;
public editSettings;
public toolbarItems;
clicked(e: any, test: any){
alert(e.target.id)
}
}
|
I've tried putting the example code into my page, but the button doesn't appear in that grid either.
Here are the versions of Angular:
@angular/cli: 1.4.4
node: 7.10.0
os: win32 x64
@angular/animations: 4.3.3
@angular/common: 4.3.3
@angular/compiler: 4.3.3
@angular/core: 4.3.3
@angular/forms: 4.3.3
@angular/http: 4.3.3
@angular/platform-browser: 4.3.3
@angular/platform-browser-dynamic: 4.3.3
@angular/router: 4.3.3
@angular/cli: 1.4.4
@angular/compiler-cli: 4.3.3
@angular/language-service: 4.3.3
typescript: 2.3.4
The version of Essential Studio is 15.2.0.40
This is the HTML snippet
<div class="card-deck-wrapper">
<div class="card-deck">
<div class="col-xl-6 col-lg-12">
<div class="card">
<div class="card-header">
Test
</div>
<div class="card-block" style="margin:4px">
<ej-grid id="Grid" [dataSource]="data" [allowPaging]="true" [toolbarSettings]="toolbarItems" [editSettings]="editSettings"
[allowSorting]="true">
<e-columns>
<e-column headerText="Photo" width="90">
<ng-template e-template let-data>
<div>
<button (click)="clicked($event, data.OrderID)">...</button>
</div>
</ng-template>
</e-column>
<e-column field="OrderID" headerText="OrderID" [isPrimaryKey]="true" width="75"></e-column>
<e-column field="CustomerID" headerText="CustomerID" width="80"></e-column>
<e-column field="EmployeeID" headerText="EmployeeID" width="80"></e-column>
<e-column field="Freight" headerText="Freight" width="90"></e-column>
<e-column field="ShipCountry" headerText="ShipCountry" width="90"></e-column>
</e-columns>
</ej-grid>
</div>
</div>
</div>
<div class="col-xl-6 col-lg-12">
<div class="card mb-3">
<div class="card-header">
Blank
</div>
<div class="card-block" style="margin:4px">
Blank
</div>
</div>
</div>
</div>
</div>
The only errors that I see in the console are:
polyfills.ts:19 Uncaught ReferenceError: $ is not defined
at Object.../../../../../src/polyfills.ts (polyfills.ts:19)
at __webpack_require__ (bootstrap e73e458254711559f364:54)
at Object.1 (zone.js:2709)
at __webpack_require__ (bootstrap e73e458254711559f364:54)
at webpackJsonpCallback (bootstrap e73e458254711559f364:25)
at polyfills.bundle.js:1
../../../../../src/polyfills.ts @ polyfills.ts:19
__webpack_require__ @ bootstrap e73e458254711559f364:54
1 @ zone.js:2709
__webpack_require__ @ bootstrap e73e458254711559f364:54
webpackJsonpCallback @ bootstrap e73e458254711559f364:25
(anonymous) @ polyfills.bundle.js:1
core.es5.js:2933 Template parse warnings:
The <template> element is deprecated. Use <ng-template> instead ("
[WARNING ->]<template [ngIf]="!isClosed">
<div [class]="'alert alert-' + type" role="alert" [ngClass]="classes""): ng:///AlertModule/AlertComponent.html@1:0