Search code examples
kendo-uikendo-asp.net-mvc

Calling functions with get() doesn't work in new Versions of Kendo


So the problem is that we have a kendo version of 2021 that everywhere in our project we used to call functions like this

viewModel.get("someFunction()");

and it worked fine but now that we are testing the latest Versions , it only works like this

viewModel.someFunction();

Does anyone knows why this is happening?


Solution

  • there is a change that i found on the latest update in ghub and they add this in

    Kendo UI R1 2023 (version 2023.1.117)

     exprToArray: function (expression, safe) { expression = expression || ""; var FIELD_REGEX = /[(?:(\d+)|['"](.*?)['"])]|((?:(?![.*?]|\.).)+)/g; var fields = []; expression.replace(FIELD_REGEX, function (_, index, indexAccessor, field) { fields.push(kendo.isPresent(index) ? index : (indexAccessor || field)); return undefined$1; }); return fields; },
        
        getter: function(expression, safe) { var key = expression + safe; return getterCache[key] = getterCache[key] || (function (obj) { var fields = kendo.exprToArray(expression, safe); var result = obj; for (var idx = 0; idx < fields.length; idx++) { result = result[fields[idx]]; if (!kendo.isPresent(result) && safe) { return result; } } return result; }); },