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 - JSON Data

Load JSON data by assigning its URL to the dataSource option.

jQuery
JavaScript
$(function() {
    $("#lookupContainer").dxLookup({
        dataSource: "https://jsonplaceholder.typicode.com/users",
        valueExpr: 'username',
        displayExpr: 'name'
    });
});
Angular
HTML
TypeScript
<dx-lookup
    dataSource="https://jsonplaceholder.typicode.com/users"
    valueExpr="username"
    displayExpr="name">
</dx-lookup>
import { DxLookupModule } from "devextreme-angular";
// ...
export class AppComponent {
    // ...
}
@NgModule({
    imports: [
        // ...
        DxLookupModule
    ],
    // ...
})

Note that you can also use a JSONP callback parameter supported by jQuery.ajax().

jQuery
JavaScript
$(function() {
    $("#lookupContainer").dxLookup({
        dataSource: "http://www.example.com/dataservices/jsonpdata?callback=?",
        // ...
    });
});
Angular
HTML
TypeScript
<dx-lookup ...
    dataSource="http://www.example.com/dataservices/jsonpdata?callback=?">
</dx-lookup>
import { DxLookupModule } from "devextreme-angular";
// ...
export class AppComponent {
    // ...
}
@NgModule({
    imports: [
        // ...
        DxLookupModule
    ],
    // ...
})

Implement the CustomStore if you need to process data after obtaining it. See the Custom Sources topic for more details.

See Also