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

Bug: sheet.batch interaction with custom editors

1 Answer 72 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Jeffrey
Top achievements
Rank 1
Jeffrey asked on 08 Oct 2016, 02:18 AM

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

1 Answer, 1 is accepted

Sort by
0
Mihai
Telerik team
answered on 11 Oct 2016, 03:15 PM
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.
 
Tags
Spreadsheet
Asked by
Jeffrey
Top achievements
Rank 1
Answers by
Mihai
Telerik team
Share this question
or