
templates-rythm.datasource.js Maven / Gradle / Ivy
@args String entity
define([
'common/SingletonDataSource', './@entity@Model'
], function(SingletonDataSource, @entity@Model) {
var @entity@DataSource = SingletonDataSource.define({
name: "@entity@DataSource",
parameters: {
transport: {
read: {
type: "GET",
url: AdminApp.getBackendURL() + "@entity.lowerCase()/all",
dataType: "json",
contentType: "application/json"
},
update: {
type: "POST",
url: AdminApp.getBackendURL() + "@entity.lowerCase()",
dataType: "json",
contentType: "application/json"
},
destroy: {
type: "DELETE",
url: AdminApp.getBackendURL() + "@entity.lowerCase()",
dataType: "json",
contentType: "application/json"
},
create: {
type: "PUT",
url: AdminApp.getBackendURL() + "@entity.lowerCase()",
dataType: "json",
contentType: "application/json"
},
parameterMap: function(options, operation) {
if (operation !== "read") {
return kendo.stringify(options);
}
}
},
batch: false,
pageSize: 20,
schema: {
model:@entity@Model
}
}});
return @entity@DataSource;
});
© 2015 - 2025 Weber Informatics LLC | Privacy Policy