Опитвам се да използвам връзка за редактиране на команда за редактиране на ред от kendo web ui мрежа. Проблемът е, че не мога да използвам синтаксиса "#= Id #", като Id е дефиниран като id в модела и едно от полетата силен>. Ето схемата, дефинирана в източника на данни
var dataSource = new kendo.data.DataSource({
type: "json",
.....
schema: {
model: {
id: "Id",
fields: {
Id: { type: "number" },
RequesterName: { type: "string" },
...
}
},
data: "data",
total: "total"
},
...
pageSize: 5
});
И кендо мрежата
$("#request-grid").kendoGrid({
dataSource: dataSource,
...
columns: [{
field: "Id", title: "Id", width: 35
}, {
field: "RequesterName", title: "Req Name", width: 175
}, {
...
}, {
command: [{ name: "edit", template: "<a href='/[email protected]("_SoftwareRequestEdit", "SoftwareRequest")" + "/#= Id #" + "'>Edit</a>" }]
}],
...
});
С горния код, когато мрежата се зареди, получавам следната грешка в javascript
ReferenceError: Id is not defined
#11 http://localhost:49713/Admin/SoftwareRequest/SoftwareRequestList:3
#10 http://localhost:49713/Scripts/Kendo/kendo.web.js:294:22 eval (eval at ()
#9 http://localhost:49713/Scripts/Kendo/kendo.web.js:26361:44 Widget.extend._createButton()
#8 http://localhost:49713/Scripts/Kendo/kendo.web.js:27571:38 Widget.extend._cellTmpl()
#7 http://localhost:49713/Scripts/Kendo/kendo.web.js:27523:41 Widget.extend._tmpl()
#6 http://localhost:49713/Scripts/Kendo/kendo.web.js:27624:37 Widget.extend._templates()
#5 http://localhost:49713/Scripts/Kendo/kendo.web.js:25055:18 new Widget.extend.init()
#4 http://localhost:49713/Scripts/Kendo/kendo.web.js:2785:25 HTMLDivElement.()
#3 http://localhost:49713/Scripts/jquery-2.1.0.js:381:23 Function.jQuery.extend.each()
#2 http://localhost:49713/Scripts/jquery-2.1.0.js:137:17 jQuery.fn.jQuery.each()
#1 http://localhost:49713/Scripts/Kendo/kendo.web.js:2784:26 $.fn.(anonymous function) [as kendoGrid]
Както можете да видите, дефинирах Id в модела, но все още получавам ReferenceError: Id не е дефиниран. Някакви улики за същото.