Server Side Basic Data Binding

Server side data binding allow users to bind large data sets that are not directly accessible as a full collection in client side due to various reasons. Server side data binding can improve performance drastically for large data sets but integration is fairly complex compared to Client Side Basic Data Binding and Client Side Stream Data Binding techniques.

Unlike in Client Side Basic Data Binding, server side rendering will request for data on dropdown initialization and whenever user performs Server Side Filtering operation. Ornamentum has provided an optional opinionated service to integrate external data sources. Also, you can build a custom data provider depending on your requirement.

What You Will See

import { Component } from '@angular/core';

import { DropdownDataBindCallback, DropdownHttpResourceFactoryService } from 'ornamentum';

import { ExampleData } from 'helper-models';

  selector: 'app-server-side-basic-usage',
  templateUrl: './server-side-basic-usage.component.html'
export class ServerSideBasicUsageComponent {
  public onDataBind: DropdownDataBindCallback<ExampleData>;

  constructor(private resourceFactory: DropdownHttpResourceFactoryService) {
    const exampleDataResource = resourceFactory.getResourceProvider<ExampleData>();
    this.onDataBind = exampleDataResource.onDataBind('/api/data');

Basic Usage

Server side data binding is handled via onDataBind callback function. Use this callback reference to hook into data bind workflow and provide custom data source. This callback function will get triggered on dropdown initialization and on dynamic dropdown operations. It receives DropdownRequestParams argument and expect to return RxJS Observable query result DropdownQueryResult<T> object stream. Data returned from this callback function will be directly bound to dropdown assuming that it matches the on demand request context.

For use of Server side basic data binding operations it is mandatory to import DropdownResourceModule to your application module.


Following code snippet represent an example implementation of onDataBind callback.

API Doc for Server Side Basic Data Binding