DevExtreme jQuery/JS - Web API, PHP, MongoDB

DevExtreme provides the following extensions for binding to Web API, PHP, and MongoDb services:

These extensions enable server-side filtering, sorting, grouping, and other data shaping operations according to the protocol that DevExtreme UI components use. Follow the links above for information on how to configure the extensions on the server.

To access the server from the client, configure the CustomStore as described in the Custom Data Sources article or use the createStore method. This method is part of DevExtreme.AspNet.Data, but it can also be used with the other extensions. The code below demonstrates how to use it.

NOTE
Configure remoteOperations in the DataGrid, TreeList, and PivotGridDataSource or remoteFiltering in the Scheduler to notify the UI components of the server's data shaping operations. Other DevExtreme UI components do not need this setting.
jQuery
index.js
$(function() {
    var serviceUrl = "https://mydomain.com/MyDataService";

    $("#dataGridContainer").dxDataGrid({
        dataSource: DevExpress.data.AspNet.createStore({
            key: "ID",
            loadUrl: serviceUrl + "/GetAction",
            insertUrl: serviceUrl + "/InsertAction",
            updateUrl: serviceUrl + "/UpdateAction",
            deleteUrl: serviceUrl + "/DeleteAction"
        }),
        remoteOperations: { groupPaging: true }
    });
});
Angular
app.component.html
app.component.ts
app.module.ts
<dx-data-grid
    [dataSource]="remoteDataSource">
    <dxo-remote-operations
        [groupPaging]="true">
    </dxo-remote-operations>
</dx-data-grid>
import { Component } from '@angular/core';
import { createStore } from 'devextreme-aspnet-data-nojquery';

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
})
export class AppComponent {
    remoteDataSource: any;

    constructor() {
        const serviceUrl: String = 'https://mydomain.com/MyDataService';
        this.remoteDataSource = createStore({
            key: 'ID',
            loadUrl: serviceUrl + '/GetAction',
            insertUrl: serviceUrl + '/InsertAction',
            updateUrl: serviceUrl + '/UpdateAction',
            deleteUrl: serviceUrl + '/DeleteAction'
        });
    }
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';

import { DxDataGridModule } from 'devextreme-angular';

@NgModule({
    declarations: [
        AppComponent
    ],
    imports: [
        BrowserModule,
        DxDataGridModule
    ],
    providers: [ ],
    bootstrap: [AppComponent]
})
export class AppModule { }
Vue
App.vue
<template>
    <DxDataGrid
        :data-source="remoteDataSource">
        <DxRemoteOperations :group-paging="true" />
    </DxDataGrid>
</template>

<script>
import 'devextreme/dist/css/dx.light.css';

import DxDataGrid, {
    DxRemoteOperations
} from 'devextreme-vue/data-grid';

import { createStore } from 'devextreme-aspnet-data-nojquery';

const serviceUrl = 'https://mydomain.com/MyDataService';

const remoteDataSource = createStore({
    key: 'ID',
    loadUrl: serviceUrl + '/GetAction',
    insertUrl: serviceUrl + '/InsertAction',
    updateUrl: serviceUrl + '/UpdateAction',
    deleteUrl: serviceUrl + '/DeleteAction'
});

export default {
    components: {
        DxDataGrid,
        DxRemoteOperations
    },
    data() {
        return {
            remoteDataSource
        }
    }
}
</script>
React
App.js
import React from 'react';

import 'devextreme/dist/css/dx.light.css';

import DataGrid, {
    RemoteOperations
} from 'devextreme-react/data-grid';

import { createStore } from 'devextreme-aspnet-data-nojquery';

const serviceUrl = 'https://mydomain.com/MyDataService';

const remoteDataSource = createStore({
    key: 'ID',
    loadUrl: serviceUrl + '/GetAction',
    insertUrl: serviceUrl + '/InsertAction',
    updateUrl: serviceUrl + '/UpdateAction',
    deleteUrl: serviceUrl + '/DeleteAction'
});

class App extends React.Component {
    render() {
        return (
            <DataGrid
                dataSource={remoteDataSource}>
                <RemoteOperations groupPaging={true} />
            </DataGrid>
        );
    }
}
export default App;

View on GitHub View on GitHub

A 1-Click Solution for CRUD Web API Services with Role-based Access Control via EF Core

If you target .NET for your backend API, be sure to check out Web API Service and register your free copy today. The Solution Wizard scaffolds an OData v4 Web API Service (.NET 6+) with integrated authorization & CRUD operations powered by EF Core ORM. You can use OAuth2, JWT or custom authentication strategies alongside tools like Postman or Swagger (OpenAPI) for API testing. The built-in Web API Service also filters out secured server data based on permissions granted to users. Advanced/enterprise functions include audit trail, endpoints to download reports, file attachments, check validation, obtain localized captions, etc.

To use the free Solution Wizard (which creates the Web API Service), run the Universal Component Installer from the DevExpress Download Manager and use our predefined template in Visual Studio 2022+.

Read Tutorial | View Examples: JavaScript (DevExtreme) & JavaScript (Svelte) | Watch Videos

See Also