DevExtreme v25.1 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

JavaScript/jQuery Card View - Web API Service

To access a Web API service from the client, use the createStore method which is part of the DevExtreme.AspNet.Data extension. This extension also allows you to process data for DevExtreme components on the server.

To notify our JavaScript CardView that data is processed on the server, set the remoteOperations property to true.

Backend API
const url = 'https://js.devexpress.com/Demos/NetCore/api/TreeListTasks'; $(() => { const store = DevExpress.data.AspNet.createStore({ key: 'Task_ID', loadUrl: `${url}/Tasks`, insertUrl: `${url}/InsertTask`, updateUrl: `${url}/UpdateTask`, deleteUrl: `${url}/DeleteTask`, onBeforeSend(method, ajaxOptions) { ajaxOptions.xhrFields = { withCredentials: true }; }, }); $('#card-view').dxCardView({ dataSource: store, remoteOperations: true, cardsPerRow: 'auto', cardMinWidth: 280, wordWrapEnabled: true, columns: [ { caption: 'Subject', dataField: 'Task_Subject', validationRules: [{ type: 'required' }] }, { dataField: 'Task_Start_Date', caption: 'Start Date', dataType: 'date', }, { dataField: 'Task_Due_Date', caption: 'Due Date', dataType: 'date', }, { caption: 'Priority', dataField: 'Task_Priority', }, { caption: 'Status', dataField: 'Task_Status', }, ], headerFilter: { visible: true, }, editing: { allowAdding: true, allowUpdating: true, allowDeleting: true, popup: { width: 700, height: 400, }, form: { items: ['Task_Subject', 'Task_Start_Date', 'Task_Due_Date', { dataField: 'Task_Priority', editorType: 'dxSelectBox', editorOptions: { dataSource: ['Low', 'Normal', 'High', 'Urgent'], }, }, 'Task_Status'] }, }, searchPanel: { visible: true, }, }); });
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script>window.jQuery || document.write(decodeURIComponent('%3Cscript src="js/jquery.min.js"%3E%3C/script%3E'))</script> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/25.1.3/css/dx.light.css" /> <script src="js/dx.all.js"></script> <script src="https://unpkg.com/devextreme-aspnet-data@5.0.0/js/dx.aspnet.data.js"></script> <script src="index.js"></script> <link rel="stylesheet" type="text/css" href="styles.css" /> </head> <body class="dx-viewport"> <div class="demo-container"> <div id="card-view"></div> </div> </body> </html>