$(document).ready(function () {
var gridOptions = {
color: 'LightSkyBlue',
dataSource: gridData,
paging: { pageSize: 15 },
height: "90%",
selection: { mode: "single" },
editing: {
mode: "form",
editEnabled: true,
insertEnabled: true,
removeEnabled: true
},
filterRow: { visible: false },
columnChooser: { enabled: true },
columnAutoWidth: true,
searchPanel: { visible: true },
groupPanel: { visible: true },
allowColumnReordering: true,
allowColumnResizing: true,
rowAlternationEnabled: false,
rowClick: function (data) {
},
selectionChanged: function (selectedItems) {
},
@*columns: [
@foreach(var item in Model.Columns){
<text>
{ dataField: "@item.FieldName", caption: "@item.Caption" },
</text>
}
]*@
};
Asked
Active
Viewed 1,554 times
0

Niranjan Singh
- 18,017
- 2
- 42
- 75

pelin eliaçık
- 9
- 6
-
2Please, describe your problem in the question body rather than post only the code. – il_raffa Dec 07 '15 at 09:12
1 Answers
2
Source: How to implement CRUD operations with a DataSource
To implement CRUD operations with a DataSource that obtains data from a remote Rest service. The DataSource object does not implement CRUD operations out-of-the-box. We can do this using jQuery.ajax. It is also necessary to call the DataSource.load method to "inform" your widget that it is necessary to reload its content.
example code snippet to add item to data source using a view:
Application1.addView = function (params) {
var viewModel = {
categoryName: ko.observable(),
btnSaveClick: function (e) {
var category = {
CategoryID: 0,
CategoryName: viewModel.categoryName()
}
Application1.db.insert(category).done(function (data) {
app.back();
});
}
};
return viewModel;
};
References:
How to implement CRUD operations with a DataSource
dxDataGrid - How to implement a custom store with CRUD operations (SQLite)
Hope this help you to move forward. :)

Community
- 1
- 1

Niranjan Singh
- 18,017
- 2
- 42
- 75