I have made a nice grid. Everything was fine until I made it editable.
When clicking in a cell, Firebug showed this error:
model is undefined
In Chrome:
Uncaught TypeError: Cannot call method 'editable' of undefined
After some research, I found the cause of the problem, and its solution. I want to share it here. If someone else faces the same issue, may save a bit of time...
The problem happened because I had a rowTemplate configuration for the grid. When the row is generated by Kendo, it automatically adds a data-id attribute to the table-row (tr) element. To fix the issue, I had to add this to my row template. In my case, the whole row contents are generated by a JavaScript function. I manually added the missing data-id attribute in the tr like this:
Of course, the data-id attribute must have the proper "id" value for that row.
I hope this helps...
When clicking in a cell, Firebug showed this error:
model is undefined
In Chrome:
Uncaught TypeError: Cannot call method 'editable' of undefined
After some research, I found the cause of the problem, and its solution. I want to share it here. If someone else faces the same issue, may save a bit of time...
The problem happened because I had a rowTemplate configuration for the grid. When the row is generated by Kendo, it automatically adds a data-id attribute to the table-row (tr) element. To fix the issue, I had to add this to my row template. In my case, the whole row contents are generated by a JavaScript function. I manually added the missing data-id attribute in the tr like this:
function
myRowBuilderFunction(data) {
return
'<tr data-id="'
+ data.my_id_field +
'">'
+ table_cells +
'</tr>'
;
}
Of course, the data-id attribute must have the proper "id" value for that row.
I hope this helps...