javascript - Kendo UI JS grid editing cells won't work and gives no error -
when press of cells cell focused can't type in field. no console errors whatsoever. here code:
$(document).ready(function () { datasource = new kendo.data.datasource({ transport: { read: { url: '/discountpromotion/get', datatype: "json", }, update: { url: '/discountpromotion/update', datatype: "json", type: "post", contenttype: "application/json" }, destroy: { url: '/discountpromotion/delete', datatype: "json", type: "post", contenttype: "application/json" }, create: { url: '/discountpromotion/add', datatype: "json", type: "post", contenttype: "application/json" }, parametermap: function(options, operation) { if (operation !== "read") { return json.stringify({ discountpromotiondto: options }); } }, }, pagesize: 10, schema: { model: { id: "id", fields: { id: { type: "number" }, code: { type: "string" }, startdate: { type: "date" }, enddate: { type: "date" }, minimumcost: { type: "number" }, maximumcost: { type: "number" }, quantity: { type: "number" }, customerid: { type: "number" }, countrycode: { type: "string" }, discount: { type: "number" }, modelname: { type: "string" } } } } }); $("#discountpromotiongrid").kendogrid({ datasource: datasource, batch: true, toolbar: ["create", "save", "cancel"], height: 400, navigatable: true, pageable: { refresh: true, pagesizes: true, buttoncount: 5 }, columns: [ { field: "modelname", title: "modelname", editor: modelnamedropdown, template: "#=modelname#", width: 150 }, { field: "code", title: "promotioncode", width: 150 }, { field: "startdate", title: "startdate", template: '#= kendo.tostring(startdate,"yyyy-mm-dd") #', width: 120 }, { field: "enddate", title: "enddate", template: '#= kendo.tostring(enddate,"yyyy-mm-dd") #', format: "{0:yyyy-mm-dd}", parseformats: ["yyyy-mm-dd"], width: 120 }, { field: "minimumcost", title: "mincost", width: 100 }, { field: "maximumcost", title: "maxcost", width: 100 }, { field: "quantity", title: "quantity", width: 80 }, { field: "customerid", title: "customerid", width: 80 }, { field: "countrycode", title: "countrycode", width: 40 }, { field: "discount", title: "discount", width: 40 }, { command: "destroy", title: " ", width: 120 }], editable: true }); function modelnamedropdown(container, options) { $('<input required data-text-field="modelname" data-value-field="modelname" data-bind="value:' + options.field + '"/>') .appendto(container) .kendodropdownlist({ autobind: false, optionlabel: "select model...", datasource: { serverfiltering: true, transport: { read: { url: '/discountpromotion/getmodelnamesbycustomerid', datatype: "json", type: "post", contenttype: "application/json" } } } }); }
please help! have no clue wrong.
here image of grid , when have pressed cell. there marker never shows in cell can't type anything. , occurs on of them!
you need add edit command columns.
{ command: ["edit", "destroy"], title: " ", width: 120 }], editable: "inline"
Comments
Post a Comment