Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created September 21, 2016 05:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goofmint/50b908a0a8ec843e4d70d4aa79ad2f09 to your computer and use it in GitHub Desktop.
Save goofmint/50b908a0a8ec843e4d70d4aa79ad2f09 to your computer and use it in GitHub Desktop.
5.md
var dataSource = datagrid.createDataSource({
idProperty: 'id',
type: 'ajax',
param: {
ajax: dumyAjax,
search: {
request: function(param) {
return {
type: 'search',
param: param
};
},
response: function(result) {
return result;
}
},
fetch: {
request: function(param, range) {
return {
type: 'fetch',
param: param,
range: range
};
},
response: function(result) {
return result;
}
},
find: {
request: $.noop,
response: $.noop
},
commit: {
request: function(edit) {
return {
type: 'commit',
edit: edit.getReplacedDataSet()
};
},
response: $.noop
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment