Hi,
I obviously missed something in the documentation, leading to this result when i try to use syncfusion modules :
packages.json"dependencies": {
(...)
"@syncfusion/ej2": "16.1.24",
"@syncfusion/ej2-base": "16.1.24",
"@syncfusion/ej2-cards": "16.1.24",
"@syncfusion/ej2-lists": "16.1.24",
"@syncfusion/ej2-buttons": "16.1.24",
"@syncfusion/ej2-grids": "16.1.24",
"@syncfusion/ej2-inputs": "16.1.24",
"@syncfusion/ej2-popups": "16.1.24",
"@syncfusion/ej2-ng-base": "16.1.24",
"@syncfusion/ej2-ng-buttons": "16.1.24",
"@syncfusion/ej2-ng-lists": "16.1.24",
"@syncfusion/ej2-ng-grids": "16.1.24",
"@syncfusion/ej2-ng-dropdowns": "16.1.24",
"@syncfusion/ej2-ng-calendars": "16.1.24",
"@syncfusion/ej2-ng-navigations": "16.1.24",
"@syncfusion/ej2-ng-inputs": "16.1.24",
"@syncfusion/ej2-ng-popups": "16.1.24",
"@syncfusion/ej2-ng-splitbuttons": "16.1.24"
}
vendor.ts (Webpack entry):
import "@syncfusion/ej2/bootstrap.scss";
import "@syncfusion/ej2-base/styles/bootstrap.scss";
import "@syncfusion/ej2-ng-grids/styles/bootstrap.scss";
import "@syncfusion/ej2-grids/styles/bootstrap.scss";
import "@syncfusion/ej2-dropdowns/styles/bootstrap.scss";
import "@syncfusion/ej2-ng-dropdowns/styles/bootstrap.scss";
In my module.ts i do the required imports:import { GridAllModule } from '@syncfusion/ej2-ng-grids';
import { NumericTextBoxAllModule } from '@syncfusion/ej2-ng-inputs';
import { CheckBoxAllModule, RadioButtonAllModule } from '@syncfusion/ej2-ng-buttons';
import { MultiSelectAllModule, DropDownListAllModule } from '@syncfusion/ej2-ng-dropdowns';
import { DialogAllModule, TooltipAllModule, PopupAllModule } from '@syncfusion/ej2-ng-popups';
(...)
@NgModule({
imports: [
CommonModule,
SharedModule,
RouterModule.forChild(routes),
GridAllModule, DropDownListAllModule,
NumericTextBoxAllModule, NumericTextBoxAllModule, CheckBoxAllModule, RadioButtonAllModule,
MultiSelectAllModule, DialogAllModule, TooltipAllModule, PopupAllModule
],
my component.html:<div class="panel-body">
<div class="select-wrap">
<ejs-dropdownlist id='ddlelement' value='Menu' [dataSource]='ddldata' [fields]='ddlfields' (change)="onChange($event)"></ejs-dropdownlist>
</div>
<ejs-grid #grid [dataSource]='data' allowPaging='true' [pageSettings]='pageSettings' [filterSettings]='filterSettings'>
<e-columns>
<e-column field='Id' headerText='Id' width='120' textAlign='Right'></e-column>
<e-column field='Reference' headerText='Reference' width='150'></e-column>
<e-column field='Description' headerText='Description'></e-column>
</e-columns>
</ejs-grid>
</div>
My component.scss:@import "ej2/bootstrap.scss";
@import "ej2-base/styles/bootstrap.scss";
@import "ej2-ng-grids/styles/bootstrap.scss";
@import "ej2-grids/styles/bootstrap.scss";
@import "ej2-dropdowns/styles/bootstrap.scss";
@import "ej2-ng-dropdowns/styles/bootstrap.scss";
My component.ts:import { Component, OnInit, ViewChild } from '@angular/core';
import { DataManager, ODataV4Adaptor } from '@syncfusion/ej2-data';
import { GridComponent, FilterService, FilterType, PageSettingsModel } from '@syncfusion/ej2-ng-grids';
import { ChangeEventArgs } from '@syncfusion/ej2-dropdowns';
import { DropDownListComponent } from '@syncfusion/ej2-ng-dropdowns';
const serviceUri: string = 'https://127.0.0.1:9007/api/ODataCatalog';
@Component({
selector: 'gridCatalog',
styleUrls: ['gridcatalog.component.scss'],
templateUrl: './gridcatalog.component.html'
})
export class GridCatalogComponent implements OnInit {
public data: DataManager;
public pageSettings: Object;
public ddldata: Object[];
public filterSettings: Object;
public filteringType: Object[] = [
{ Id: 'Menu', type: 'Menu' },
{ Id: 'CheckBox', type: 'Checkbox' },
{ Id: 'Excel', type: 'Excel' }
];
public ddlfields: Object = { text: 'type', value: 'Id' };
@ViewChild('grid')
public grid: GridComponent;
ngOnInit(): void {
this.data = new DataManager({ url: serviceUri, adaptor: new ODataV4Adaptor, crossDomain: true });
this.pageSettings = { pageCount: 5 };
this.filterSettings = { type: 'Menu' };
this.ddldata = this.filteringType;
}
public onChange(e: ChangeEventArgs): void {
this.grid.filterSettings.type = <FilterType>e.value;
this.grid.clearFiltering();
}
}
Note: