All docs
V19.1
24.1
The page you are viewing does not exist in version 24.1.
23.2
The page you are viewing does not exist in version 23.2.
23.1
The page you are viewing does not exist in version 23.1.
22.2
The page you are viewing does not exist in version 22.2.
22.1
The page you are viewing does not exist in version 22.1.
21.2
The page you are viewing does not exist in version 21.2.
21.1
The page you are viewing does not exist in version 21.1.
20.2
The page you are viewing does not exist in version 20.2.
20.1
The page you are viewing does not exist in version 20.1.
19.2
19.1
18.2
18.1
17.2
A newer version of this page is available. Switch to the current version.

DevExtreme jQuery - Access the DataSource

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

jQuery
JavaScript
var selectBoxDataSource = $("#selectBoxContainer").dxSelectBox("getDataSource");
Angular
TypeScript
import { DxSelectBoxModule, DxSelectBoxComponent } from "devextreme-angular";
// ...
export class AppComponent {
    @ViewChild(DxSelectBoxComponent, { static: false }) selectBox: DxSelectBoxComponent;
    // Prior to Angular 8
    // @ViewChild(DxSelectBoxComponent) selectBox: DxSelectBoxComponent;
    ds: any = {};
    getDataSource () {
        this.ds = this.selectBox.instance.getDataSource();
    }
}
@NgModule({
     imports: [
         // ...
         DxSelectBoxModule
     ],
     // ...
 })

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

JavaScript
selectBoxDataSource.load();
See Also