import { Component } from '@angular/core'; @Component({ selector: 'app-root', template: ` <h2>Virtual Scroll</h2> <p>The Virtual Scroll allows the ComboBox to display millions of items.</p> <eui-combobox valueField="id" textField="name" [virtualScroll]="true" [data]="data" [total]="total" [pageSize]="pageSize" [rowHeight]="rowHeight"></eui-combobox> ` }) export class AppComponent { data: any[] = []; total: number = 10000; pageSize: number = 20; rowHeight: number = 30; ngOnInit() { for(let i=0; i<this.total; i++){ this.data.push({ id: i, name: 'Item'+i }); } } }
import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { BrowserModule } from '@angular/platform-browser'; import { HttpModule } from '@angular/http'; import { EasyUIModule } from 'easyui/easyui/easyui.module'; import { AppComponent } from './app.component'; @NgModule({ bootstrap: [ AppComponent ], declarations: [ AppComponent ], imports: [ FormsModule, BrowserModule, HttpModule, EasyUIModule ] }) export class AppModule { }
import { enableProdMode } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app.module'; enableProdMode(); platformBrowserDynamic().bootstrapModule(AppModule);