javascript - Kendo UI Grid not reaching Post on Controller -
i have looked @ example kendo grid here, , 1 on codeproject , thread on site, don't seem find error. i'm not knowledgeable javascript or html, expect simple mistake on part.
here code have far:
$(document).ready(function () { var baseurl = "/api/leavetypes", leavetypes = new kendo.data.datasource({ autosync: true, transport: { read: { url: baseurl + "?getall=true", datatype: "jsonp", type: "get" }, update: { url: baseurl, datatype: "jsonp", type: "post" }, parametermap: function (options, operation) { if (operation !== "read" && options.models) { return { models: kendo.stringify(options.models) }; } } }, schema: { model: { id: "id", fields: { id: {type: "number", editable: false, validation: { required: true } }, description: { type: "string", editable: false, validation: { required: true } }, isessleavetype: { type: "boolean", editable: true, }, colourrgb: {type: "string", editable: true, nullable: true } } } } }); $(".leavetypesgrid").kendogrid({ datasource: leavetypes, toolbar: ["save"], columns: [{ field: "id", title: "leave type id" }, { field: "description", title: "leave type" }, { field: "isessleavetype", template: '<input type="checkbox" #= isessleavetype ? "checked=checked" : "" # ></input>', title: "flagged ess", }, { field: "colourrgb", title: "colour" } ], scrollable: false, editable: { update: true } }); });
i trying work in jsfiddle, since i'm quite new it, i'm still struggling data source disconnected controller i'm using populate grid with, , connecting sample data.
here controller's post method:
public simpleresult post(list<leavecalendarleavetype> leavetypeslist) { return essleavedatamanager.saveleavetypes(leavetypeslist); }
any appreciated! :)
the first thing noticed have 2 data sources defined. 1 called datasource
, called leavetypes
. setting datasource on grid leavetypes
.
Comments
Post a Comment