I am currently implementing a kendo grid and I am filling it with local data. I.e; I created a JSON string from my action and provided this string on the browse page.
In the end, I would like to know if it is possible to implement full CRUD functions with local data?
here is a sample code written so far;
<div id="example" class="k-content"> <div id="grid"></div> <script> $(document).ready(function() { var myData = ${coursemodules}, dataSource = new kendo.data.DataSource({ data: myData, batch: true, pageSize: 30, schema: { model: { id: "id", fields: { id: { editable: false, nullable: true}, name: { type: "string", validation: { required: true }}, qualificationLevel: { type: "string", validation: { required: true }}, description: { type: "string", validation: { required: true }}, published: { type: "boolean" }, gateApprove: { type: "boolean" }, duration: { type: "number", validation: { min: 1, required: true } }, academicBody: { type: "string" } } } } }); $("#grid").kendoGrid({ dataSource: dataSource, height: 350, scrollable: true, sortable: true, pageable: true, toolbar: ["create", "save", "cancel"], columns: [ { field: "id", title: "ID", width: '3%' }, { field: "name", title: "Course Title", width: '20%' }, { field: "description", title:"Description", width: '35%' }, { field: "published", title: "Published", width: '7%' }, { field: "gateApprove", title: "Gate Approve", width: '7%' }, { field: "duration", title: "Duration", width: '5%' }, { field: "academicBody.shortName", title: "Academic Body", width: '10%' } ], editable: true }); }); </script> </div>
I realized that for a data source you have to declare a transport to implement CRUD. However, I need to declare "data". I tried declaring transport and data. This does not work.