This is a migrated thread and some comments may be shown as answers.

custom editor template - dataItem.dirty not recognizing changes to dataItem

3 Answers 192 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Devin
Top achievements
Rank 1
Devin asked on 01 Oct 2015, 02:57 AM

I have a grid with custom editors (kendo datepicker, kendo numericTextBox) and one field that does not have a custom editor defined

When I am in edit mode, and change the value in either of columns using custom editor templates, the dataItem.dirty flag is not changed. It is only correctly tracked in the default editor.

 

columns: [
{
    field: "amount",
title: "Amount (bps)",
//editor: function(container, options){
// container.append(amountTemplate);
//}
},
{
field: "startDate",
title: "Start Date",
template: startDateTemplate,
editor: function(container, options){
container.append(startDateTemplate);
}
},
{
field: "endDate",
title: "End Date (months)",
template: '<span ng-if="!dataItem.isBeingEdited">{{!!dataItem.endDate ? dataItem.endDate : "&boxh;"}}</span>',
editor: function(container, options){
container.append(endDateTemplate);
}
}​

3 Answers, 1 is accepted

Sort by
0
Patrick | Technical Support Engineer, Senior
Telerik team
answered on 01 Oct 2015, 10:17 PM
Hello Devin,

Take a look at my demo which illustrates how to set a custom editor with a NumericTextBox. 

Notice how I bound the data inside the input using data-bind:
function unitPriceEditor(container, options) {
  $('<input data-bind="value: ' + options.field + '"/>')
  .appendTo(container)
  .kendoNumericTextBox({
    decimals: 2,
    upArrowText: "More",
    downArrowText: "Less"
  });
}

Inside the editor, I used .appendTo(container) to use the Kendo NumericTextBox.

If this does not resolve your issue, please update my example with your amountTemplate so we can investigate the specific problem.  

Regards,
Pat
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
RYAN
Top achievements
Rank 1
answered on 01 Sep 2016, 06:41 PM

I am facing same issue. Could you please give the code with ASP.Net MVC (Razor).

 

 

 

0
Plamen
Telerik team
answered on 06 Sep 2016, 07:42 AM
Hi,

You can refer to this help article where is described how to use custom popup editor in ASP.Net MVC (Razor) application.

Regards,
Plamen
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Grid
Asked by
Devin
Top achievements
Rank 1
Answers by
Patrick | Technical Support Engineer, Senior
Telerik team
RYAN
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or