A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://js.devexpress.com/Documentation/ApiReference/Data_Layer/DataSource/ below:

DevExtreme Vue - DataSource API

The DataSource is an object that provides an API for processing data from an underlying store.

jQuery
var dataSource = new DevExpress.data.DataSource({
    // ...
    // DataSource is configured here
    // ...
});
Angular
import DataSource from "devextreme/data/data_source";
// ...
export class AppComponent {
    dataSource: DataSource;
    constructor () {
        this.dataSource = new DataSource({
            // ...
            // DataSource is configured here
            // ...
        });
    }
}
Vue
<script>
import DataSource from 'devextreme/data/data_source';

const dataSource = new DataSource({
    // ...
    // DataSource is configured here
    // ...
});

export default {
    data() {
        return {
            dataSource
        }
    }
}
</script>
React
// ...
import DataSource from 'devextreme/data/data_source';

const dataSource = new DataSource({
    // ...
    // DataSource is configured here
    // ...
});

class App extends React.Component {
    // ...
}
export default App;
React

If you use DataSource with Next.js, add a

use client directive

to ensure the instance is created on the client only. DataSource instances do not support React serialization and therefore cannot be created on the server and sent to the client.

Refer to the Data Layer and DataSource Examples articles for more information on working with data in DevExtreme.

The

DataSource

is immutable. You cannot change its configuration at runtime. However, you can use its

methods

to manipulate it.

This section describes properties that configure the DataSource.

Name Description customQueryParams

Custom parameters that should be passed to an OData service with the load query. Available only for the ODataStore.

expand

Specifies the navigation properties to be loaded with the OData entity. Available only for the ODataStore.

filter

Specifies data filtering conditions.

group

Specifies data grouping properties.

langParams

Specifies parameters for language-specific sorting and filtering.

map

Specifies an item mapping function.

onChanged

A function that is executed after data is loaded.

onLoadError

A function that is executed when data loading fails.

onLoadingChanged

A function that is executed when the data loading status changes.

pageSize

Specifies the maximum number of data items per page. Applies only if paginate is true.

paginate

Specifies whether the DataSource loads data items by pages or all at once. Defaults to false if group is set; otherwise, true.

postProcess

Specifies a post processing function.

pushAggregationTimeout

Specifies the period (in milliseconds) when changes are aggregated before pushing them to the DataSource.

requireTotalCount

Specifies whether the DataSource requests the total count of data items in the storage.

reshapeOnPush

Specifies whether to reapply sorting, filtering, grouping, and other data processing operations after receiving a push.

searchExpr

Specifies the fields to search.

searchOperation

Specifies the comparison operation used in searching.

searchValue

Specifies the value to which the search expression is compared.

select

Specifies the fields to select from data objects.

sort

Specifies data sorting properties.

store

Configures the store underlying the DataSource.

The DataSource allows you to specify CustomStore properties in its configuration object. If you define CustomStore properties as shown in the following code, they override the store.

jQuery
var infiniteList = new DevExpress.data.DataSource({
    load: function (loadOptions) {
        // Loading data objects
    },
    byKey: function (key) {
        // Retrieving a data object by key
    }
});
Angular
import DataSource from "devextreme/data/data_source";
// ...
export class AppComponent {
    infiniteList: DataSource;
    constructor() {
        this.infiniteList = new DataSource({
            load: (loadOptions) => {
                return new Promise((resolve, reject) => {
                    const data = // Loading data objects
                    resolve(data);
                });
            },
            byKey: (key) => {
                return new Promise((resolve, reject) => {
                    const obj = // Retrieving a data object by key
                    resolve(obj);
                });
            }
        });
    }
}
Vue
<script>
import DataSource from 'devextreme/data/data_source';

const infiniteList = new DataSource({
    load: (loadOptions) => {
        // Loading data objects
    },
    byKey: (key) => {
        // Retrieving a data object by key
    }
});

export default {
    // ...
    data() {
        return {
            infiniteList
        }
    }
}
</script>
React
// ...
import DataSource from 'devextreme/data/data_source';

const infiniteList = new DataSource({
    load: (loadOptions) => {
        // Loading data objects
    },
    byKey: (key) => {
        // Retrieving a data object by key
    }
});

class App extends React.Component {
    // ...
}
export default App;

This section describes methods that control the DataSource.

This section describes events that the DataSource raises.

Name Description changed

Raised after data is loaded.

loadError

Raised when data loading fails.

loadingChanged

Raised when the data loading status is changed.

Feel free to share topic-related thoughts here.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Thank you for the feedback!

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4