I just updated to the 2017 R1 release of Kendo UI (I wanted the new web font icons). After updating, my grid raises an error when I click the edit button.
The error is "Function Expected" and occurs in kendo.all.min.js on this line:
return!!e.field&&(!(t.editable&&!t.editable(e.field))&&!(e.editable&&!e.editable(t)))
The culprit line within that line is e.editable(t)
In the Visual Studio debugger e looks like:
__proto__ {...} Object
editable true Boolean
encoded true Boolean
field "SponsorFirmID" String
headerAttributes {...} Object
hidden undefined Undefined
template "<span title=\"Edit Sponsor\" style=\"cursor: pointer\">#= SponsorName# <i class=\"\"> </i></span>" String
title "Sponsor" String
width "20%" String
and t is:
AccountDescription Contractor String
AccountDisplay Carey, Christopher String
AccountID 5412 Number
AccountName ccarey String
AccountType Contractor String
AccountTypeID 1 Number
AccountURL http://adcf01w/ondemand/fid2pid.cfm?fid=5412 String
dirty FALSE Boolean
ExpireDT Tue Jan 31 2017 19:00:00 GMT-0500 (Eastern Standard Time) Object, (Date)
id ccarey String
LastConfirmedDT 0001-01-01T00:00:00 String
LastValidatedByFirmID null Null
LastValidatedByName null Null
MaxDaysToExtend 90 Number
SponsorFirmID 4793 Number
SponsorName Waldmann, Christopher String
uid ca20e06b-1935-44a0-b5f5-c44d6aa869d5 String
e {...} Object
[Methods] {...}
__proto__ {...} Object
editable TRUE Boolean
encoded TRUE Boolean
field SponsorFirmID String
headerAttributes {...} Object
hidden undefined Undefined
template <span title=\Edit
Sponsor\" style=\"cursor: pointer\">#= SponsorName# <i
class=\"\"> </i></span>" String
title Sponsor String
width 20% String
e looks like the field reference while t looks like the dataItem reference.
Here is my model in my datasource:
model: {
id: "AccountName",
fields: {
AccountID: { editable: false },
AccountName: { editable: false },
AccountDisplay: { editable: false },
AccountTypeID: { editable: false },
AccountType: { editable: false },
SponsorFirmID: { required: true },
SponsorName: { editable: false },
ExpireDT: { type: "date", required: true },
}
}
and here are the column definitions for my grid:
columns: [
{
field: "AccountDisplay", title: "Name",
headerAttributes: { style: "font-weight: bold;" },
width: "20%",
editable: false
},
{
field: "AccountType", title: "Type",
headerAttributes: { style: "font-weight: bold;" },
width: "10%",
editable: false
},
{
field: "SponsorFirmID", title: "Sponsor",
headerAttributes: { style: "font-weight: bold;" },
width: "20%",
editor: personDropDownEditor,
template: '<span title="Edit Sponsor" style="cursor: pointer">#= SponsorName# <i class=""> </i></span>',
editable: true
},
{
field: "ExpireDT",
template: (function(dataItem){
return kendo.toString(dataItem.ExpireDT, "g");
}),
title: "Expires",
headerAttributes: { style: "font-weight: bold;" },
editor: expireDateEditor,
width: "30%",
editable: true
},
{
command:[
{
text: "Confirm Row",
click: ConfirmData,
imageClass: "k-icon k-i-check",
},
"edit"
],
title: " ", width: "20%", attributes: { style: "text-align:center;" },
editable: false
}
]
I tried removing the custom editor from the SponsorFirmID field, but to no avail. This was working prior to the upgrade and works with the old kendo.all.min.js, but the edit icon does not show.