All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates-rythm.datasource.js Maven / Gradle / Ivy

There is a newer version: 0.5.0.0-1039
Show newest version
@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