'TypeError: this is undefined' error while calling the controller through ajax

2 posts, 0 answers
  1. Hudson
    Hudson avatar
    1 posts
    Member since:
    Apr 2016

    Posted 13 Apr Link to this post


    I am uploading an excel file that has some formulas in them to the kendo spreadsheet. The sheet seems to be loading in the Spreadsheet fine, but when I try to send the retrieved values from the kendo spreadsheet, there seems to be an exception - 'TypeError: this is undefined'

    function fetchDataForKidsGridModel(ExcelVals) {
        var cellValues, range, ArrOfCellValue = [], CellValueArr,
        startPoint = 17,
        mandotoryColumn = "E";
        var outletArr = [];
        var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
        var sheet = spreadsheet.activeSheet();
        var endPoint = getSheetLength(sheet, startPoint, mandotoryColumn
        for (var l = 0; l < endPoint ; l++) {
            var StartColumn_CI = 85;
            CellValueArr = [];
            var arrOfOutlets = [];
            for (var i = 0; i < ExcelVals.length ; i++) {
                var rowCellNo = ExcelVals[i].ColumnVal.replace("#", startPoint).trim();
                range = sheet.range(rowCellNo)
                cellValues = range.values();
                if (cellValues[0][0] == null) {
                    cellValues[0][0] = "";
                CellValueArr[i] = cellValues;
            ArrOfCellValue[l] = CellValueArr;
        //ERROR is thrown at this point while debugging
            url: '/UploadPO/CreateModelForGridEcomm',
            type: 'POST',
            async: true,
            dataType: 'json',
            data: { cellValues: ArrOfCellValue, BrandID: brandName }, //
                function (result) {
                    // you code comes here
        function (result) {
            //Error Handling
            if (result.success = true) {
            if (result.success = false) {

    Any help would be much appreciated.

    Feel free to ask any questions to further clarify my question..

    Thanks in advance...

  2. Alex Gyoshev
    Alex Gyoshev avatar
    2497 posts

    Posted 15 Apr Link to this post

    Hello Hudson,

    The error appears to be unrelated to the spreadsheet component, but caused by the serialization of the data that you are posting. The line "cellValues[0][57][0][0][toString]" hints at that. Please verify the problematic entry in ArrOfCellValue.

    Alex Gyoshev
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET AJAX banner
Back to Top