Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Create being called when I click delete

$
0
0

I have created a Kendo UI grid with inline editing, but when I click on the delete command my the create function of the data-source is called, not the delete function. There is probably just a simple problem with this grid but I cannot see it.

Here is my grid code.

 var grid = $("#grid").kendoGrid({
        sortable: true,
        groupable: false,
        scrollable: false,
        dataSource: {
            transport: {
                read: {
                    url: GetActionLink("RefCode", "", "", true),
                    dataType: "Json"
                },
                update: {
                    url: function(refcode) {
                        return GetActionLink("RefCode", "", refcode.Id, true);
                    },
                    type: "PUT"
                },
                destroy: {
                    url: function (refcode) {
                        return GetActionLink("RefCode", "", refcode.Id, true);
                    },
                    type: "DELETE"
                },
                create: {
                    url: function() {
                        GetActionLink("RefCode", "", "", true); //<====== break point is hit here when I click delete button ======================
                    },
                    type: "POST"
                }
            },
            schema: {
                model: {
                    id: "Value",
                    fields: {
                        Id: { type: "number", editable: false, nullable: false },
                        Type: { type: "number", nullable: false, validation: { required: true }},
                        Text: { type: "string", validation: { required: true }},
                        Order: { type: "number", validation: { required: true } }
                    }
                }
            },
            pageSize: 15
        },
        columns: [
            { field: "Type", title: "Type", width: 50, template: "#=GetLookupText(Type,RefCodeTypeData)#", editor: RefCodeTypeEditor, attributes: { style: "text-align: center;" } },
            { field: "Text", title: "Details", width: 50 },
            { field: "Order", title: "Order", width: 20, attributes: { style: "text-align: center;" } },
            { command: [{ name: "edit", text: "edit" }, { name: "destroy", text: "delete" }], title: "&nbsp;", width: 30 }
        ],
        pageable: {
            refresh: true,
            pageSizes: true,
            buttonCount: 5
        },
        editable: "inline"
    });
    


Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>