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

4 posts, 0 answers
  1. Devin
    Devin avatar
    2 posts
    Member since:
    Aug 2015

    Posted 30 Sep 2015 Link to this post

    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);
    }
    }​

  2. Patrick
    Admin
    Patrick avatar
    174 posts

    Posted 01 Oct 2015 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. RYAN
    RYAN avatar
    1 posts
    Member since:
    Sep 2012

    Posted 01 Sep in reply to Patrick Link to this post

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

     

     

     

  5. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 06 Sep Link to this post

    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.
     
Back to Top
Kendo UI is VS 2017 Ready