A RetroSearch Logo

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

Search Query:

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

DevExtreme React - Query API

The Query is an object that provides a chainable interface for making data queries.

To create a Query, call the query(array) or query(url, queryOptions) method, depending on the type of the storage you access. The Query supports method chaining. This enables you to execute several methods in a single statement.

jQuery
var dataObjects = [
    { name: "Amelia", birthYear: 1991, gender: "female" },
    { name: "Benjamin", birthYear: 1983, gender: "male" },
    { name: "Daniela", birthYear: 1987, gender: "female" },
    { name: "Lee", birthYear: 1981, gender: "male" }
];

var processedArray = DevExpress.data.query(dataObjects)
    .filter([ "gender", "=", "female" ])
    .sortBy("birthYear")
    .select("name", "birthYear")
    .toArray();
Angular
import Query from "devextreme/data/query";
// ...
export class AppComponent {
    constructor() {
        let dataObjects = [
            { name: "Amelia", birthYear: 1991, gender: "female" },
            { name: "Benjamin", birthYear: 1983, gender: "male" },
            { name: "Daniela", birthYear: 1987, gender: "female" },
            { name: "Lee", birthYear: 1981, gender: "male" }
        ];

        let processedArray = Query(dataObjects)
            .filter([ "gender", "=", "female" ])
            .sortBy("birthYear")
            .select("name", "birthYear")
            .toArray();
    }
}
Vue
<script>
import Query from 'devextreme/data/query';

const dataObjects = [
    { name: 'Amelia', birthYear: 1991, gender: 'female' },
    { name: 'Benjamin', birthYear: 1983, gender: 'male' },
    { name: 'Daniela', birthYear: 1987, gender: 'female' },
    { name: 'Lee', birthYear: 1981, gender: 'male' }
];

export default {
    mounted() {
        this.processedArray = Query(dataObjects)
            .filter([ 'gender', '=', 'female' ])
            .sortBy('birthYear')
            .select('name', 'birthYear')
            .toArray();
    },
    // ...
}
</script>
React
// ...
import Query from 'devextreme/data/query';

const dataObjects = [
    { name: 'Amelia', birthYear: 1991, gender: 'female' },
    { name: 'Benjamin', birthYear: 1983, gender: 'male' },
    { name: 'Daniela', birthYear: 1987, gender: 'female' },
    { name: 'Lee', birthYear: 1981, gender: 'male' }
];

class App extends React.Component {
    constructor(props) {
        super(props);

        this.processedArray = Query(dataObjects)
            .filter([ 'gender', '=', 'female' ])
            .sortBy('birthYear')
            .select('name', 'birthYear')
            .toArray();
    }
}
export default App;
See Also

This section describes methods that perform operations on data associated with the Query.

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