DevExtreme jQuery - Access the DataSource

Regardless of the data source you use, the TagBox always wraps it in a DataSource. Call the getDataSource() method to get the instance of the DataSource.

jQuery
JavaScript
var tagBoxDataSource = $("#tagBoxContainer").dxTagBox("getDataSource");
Angular
TypeScript
import { ViewChild, ... } from "@angular/core";
import { DxTagBoxModule, DxTagBoxComponent } from "devextreme-angular";
// ...
export class AppComponent {
    @ViewChild(DxTagBoxComponent, { static: false }) tagBox: DxTagBoxComponent;
    // Prior to Angular 8
    // @ViewChild(DxTagBoxComponent) tagBox: DxTagBoxComponent;
    ds: any = {};
    getDataSource () {
        this.ds = this.tagBox.instance.getDataSource();
    }
}
@NgModule({
     imports: [
         // ...
         DxTagBoxModule
     ],
     // ...
 })

Now, you can call any method the DataSource exposes. For example, you can reload data using the load() method.

JavaScript
tagBoxDataSource.load();
See Also