Sheet validation, not sure how to set this up properly

3 posts, 0 answers
  1. Steve
    Steve avatar
    1883 posts
    Member since:
    Dec 2008

    Posted 10 May Link to this post

    So I need my spreadsheet to have a header row, and every row below be where the data is entered... so I've got that setup fine I think.

    Now I need to define validation rules on ranges, so like K2:K40 can only have 1-5... I was able to do this in the widgetCreated event

    sheet.range("K2:K40").validation({
                    type: "warning",
                    from: "1",
                    to: "5",
                    allowNulls: true,
                    comparerType: "between",
                    dataType: "number",
                    messageTemplate: "PGYs are 1-5"
                });

     

    My current struggle though is being able to find out the total validation errors in the sheet... the code provided here

    https://www.telerik.com/forums/retrieve-validation-errors-programatically

    and here

    https://docs.telerik.com/kendo-ui/controls/data-management/spreadsheet/how-to/get-flagged-cells

    Always fails, the "cell.validation" in range.forEachCell is always undefined... what am I doing wrong here?

     

  2. Steve
    Steve avatar
    1883 posts
    Member since:
    Dec 2008

    Posted 10 May in reply to Steve Link to this post

    Scratch that, found the problem, this is setup correct, it's just $scope isn't available in the change event...eugh
  3. Joana
    Admin
    Joana avatar
    156 posts

    Posted 14 May Link to this post

    Hi Steve,

    I am glad that you managed to pin down the cause of the issue.

    In the change event of the SpreadSheet widget you could take reference of the scope as follows:

    change: function (e) {
      console.log(this.$angular_scope);
    }

    http://dojo.telerik.com/@jivanova/oqaHagAW

    Regards,
    Joana
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top