Hello,
I noticed that custom editor is partially working, or I am doing something wrong.
This example works, when template is actually referencing the model. So, initial value is setup from the template referencing the model, and edit is done by calling "CustomEditor" function where I have full flexibility for editing (kendoDatePicker, kendoTimePicker, or even create my own HTML and append it to container). Here is definition of grid column:
In addition I would like that my initial cells of grid looks a bit different, each cell have different behavior depending on model (enable/disable, color, background-color, ...).
To achieve that, I wanted to use function call in template instead of referencing the model. So I defined the function that will accept the model and index of current item in my model, and will return apropriate HTML depending on the model;
And setup call to this function within the template:
I noticed that custom editor is partially working, or I am doing something wrong.
This example works, when template is actually referencing the model. So, initial value is setup from the template referencing the model, and edit is done by calling "CustomEditor" function where I have full flexibility for editing (kendoDatePicker, kendoTimePicker, or even create my own HTML and append it to container). Here is definition of grid column:
gridColumns.push({
title: fieldDefinition.Title,
width: '100px',
field: fieldDefinition.Name,
template: "#=Fields[" + i + "].Value#",
editor: CustomEditor });
In addition I would like that my initial cells of grid looks a bit different, each cell have different behavior depending on model (enable/disable, color, background-color, ...).
To achieve that, I wanted to use function call in template instead of referencing the model. So I defined the function that will accept the model and index of current item in my model, and will return apropriate HTML depending on the model;
CreateTemplate(model, index){ .... }
And setup call to this function within the template:
gridColumns.push({
title: fieldDefinition.Title,
width: '100px',
field: fieldDefinition.Name,
template: "#= MyModule.createTemplate(data, " + i + ") #",
editor: CustomEditor });
Now, I have my template function getting called and initial cells are how I wanted them to be, but my CustomEditor is not called when I click on the cell, like it was called in the first example.
It seems that even propagation is stopped, so when I click on input that is added through template, CustomEditor is not called, but if I click in tiny space between cell and input element (that is inside the same cell) then CustomEditor is called.
Am I doing something wrong or this is bug/limitation in Kendo?
Regards,
Nole