Bug: sheet.batch interaction with custom editors

2 posts, 0 answers
  1. Jeffrey
    Jeffrey avatar
    6 posts
    Member since:
    Sep 2016

    Posted 07 Oct Link to this post

    Hi Kendo Team,

     

    I think I may have found a bug but it would be nice if I could confirm it with you guys.

    My team has been trying to wrap our code where we attach custom editors to cell ranges inside of a sheet.batch call to optimize the speed of our application.

    However we noticed that when we do this, it seems to cause the custom editors to break (whether they are list dropdowns or date pickers).

    You can replicate it in the kendo demo you guys have here:

    http://docs.telerik.com/kendo-ui/controls/data-management/spreadsheet/how-to/validation-to-column

    If you scroll to the very bottom of the edit section of the demo and change where you apply the validation rule by enabling showButton and putting it inside a sheet.batch, you will see that the dropdown list selectors in the demo preview will not work at all (they appear but nothing is displayed).

            //Apply the validation rule
            $("#spreadsheet").data("kendoSpreadsheet").activeSheet().batch(function () {
            range.validation({
              dataType: "list",
              from: "ListValues!A$1:B$1",
              allowNulls: true,
              type: "reject",
              titleTemplate: "Invalid value",
              messageTemplate: "Valid values are 'true' and 'false'."
            });
            });

     

    In fact, if you replace that range.validation with a different type of validation like the date picker, it will also break - the icons will be displayed when selecting the cell but clicking the icon brings up an empty date picker that does not work.

     

            $("#spreadsheet").data("kendoSpreadsheet").activeSheet().batch(function () {
            range.validation({
              dataType: "date",
              showButton: true,
              comparerType: "between",
              from: "DATEVALUE(\"1/1/1900\")",
              to: "DATEVALUE(\"1/1/1998\")",
              allowNulls: true,
              type: "reject",
              titleTemplate: "Birth Date validaiton error",
              messageTemplate: "Birth Date should be between 1899 and 1998 year."
            });
            });

     

    For whatever reason by putting the custom editors into the batch calls, it seems to be losing the "from" range to check against (seeing as the red arrow still works and the messageTemplate also displays properly on hover.

    Thoughts?

    Thanks,

    Jeff

  2. Mihai
    Admin
    Mihai avatar
    153 posts

    Posted 11 Oct Link to this post

    Hello,

    A workaround for the issue is to pass { recalc: true } as second argument to batch.  Here's an example: http://dojo.telerik.com/Ulito

    I will consult with the team on whether the batch method should do this by default.

    Regards,
    Mihai
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  3. Kendo UI is VS 2017 Ready
Back to Top