I have a text area editor for a cell as follows:
This works fine when I edit the cell. But how do I make it so that VIEWING the cell looks the same? I want each row, even when it is not being edited, to display a text area.
The problem is I cannot figure out how to get "template:" to do this, as there seems to be no way for me to call the right jquery inside of the template for a field to make it a kendo text area instead of a normal text area. Any ideas?
{ field: "Comments", template: ReadEditor, editor: CommentsEditor, title: "Comments", format: "{0:c}", width: "200px" },
function CommentsEditor(container, options) {
console.log(
"CommentsEditor!!!"
);
console.log(options.field);
console.log(options);
$(
'<textarea rows="4" cols="40" data-bind="value:'
+ options.field +
'">'
+ options.model.Comments +
' </textarea>'
)
.appendTo(container)
.kendoEditor();
}
function ReadEditor(input) {
// $('<textarea rows="4" cols="40" ">' + input.Comments + ' </textarea>').kendoEditor(); CANT DO THIS!
return '<textarea rows="4" cols="40" ">' + input.Comments + ' </textarea>';
}
This works fine when I edit the cell. But how do I make it so that VIEWING the cell looks the same? I want each row, even when it is not being edited, to display a text area.
The problem is I cannot figure out how to get "template:" to do this, as there seems to be no way for me to call the right jquery inside of the template for a field to make it a kendo text area instead of a normal text area. Any ideas?
{ field: "Comments", template: ReadEditor, editor: CommentsEditor, title: "Comments", format: "{0:c}", width: "200px" },