Hi - I have a grid that I am doing batch updates on, and I'm getting an error as shown in the attached screen shot. I'm not sure what I'm doing wrong? The text of the error is "Uncaught TypeError: Cannot call method "call" of undefined.
Thanks for any help.
Lisa
Here is my code:
Thanks for any help.
Lisa
Here is my code:
/** * This is a security dashboards controller */define([ 'wsipccontext', 'jquery', 'underscore', 'utils/helpers', 'utils/alerts', 'kendoui/kendo.core.min', 'kendoui/kendo.data.min', 'kendoui/kendo.splitter.min', 'kendoui/kendo.panelbar.min', 'kendoui/kendo.grid.min'], function (WSIPCContext, $, _, Helpers, Alerts, studentDetailTemplate) { //PRIVATE PROPERTIES var ksCharts, ksMain, kgSecurityGrid, ksChartsAndGrid, kpbContent, firstPass, nextRead, dsSchoolRiskFactors; //CONSTRUCTOR var init = function () { //ON DOC READY $(function () { initElements(); onInitialLoad(); }); }; var init1 = function () { //ON DOC READY $(function () { onInitialLoad(); }); }; //EVENTS var initElements = function () { firstPass = true; nextRead = false; ksMain = $("#main").kendoSplitter({ orientation: "horizontal", panes: [{ size: "240px", collapsible: true, scrollable: true }] }).data("kendoSplitter"); kpbContent = $("#linkPanel").kendoPanelBar().data("kendoPanelBar"); kpbContent.append([ { text: "Additional Dashboards", content: "<a href='/DistrictEWSDashboard/'><img src='/assets/images/EWS District TN.png' /> <a href='/admindashboards/'><img src='/assets/images/EWS School TN.png' /> </a><a href='/StudentEWSDashboard/'><img src='/assets/images/EWS Student.png' /> </a><a href='/AdminDashboards.aspx/'><img src='/assets/images/Portal-big.png' /></a>" } ]); kpbContent = $("#panelBar").kendoPanelBar().data("kendoPanelBar"); kpbContent.element.find("#comparativeDashboardPanelContents").css("height", "1104px"); kpbContent.element.find("#gridPane").css("height", "770px"); kpbContent.expand(kpbContent.element.find("li:first")); kgSecurityGrid = $("#securityGrid").kendoGrid({ scrollable: true, columns: [ { field: "Username", title: "User Name", width: 150, editable: false }, { field: "FreeReduced", title: "Free and Reduced", width: 50 }, { field: "SpecEd", title: "Spec Ed", width: 60 }, { field: "Discipline", title: "Discipline", width: 50 }, { field: "Assessment", title: "Assessment", width: 50 }, { field: "Activities", title: "Activities", width: 50 }, { command: ["destroy"], title: " ", width: "172px" }, ], dataSource: { transport: { read: function (options) { if (!(kgSecurityGrid)) { options.success([]); return; } kendo.ui.progress(kgSecurityGrid.element, true); $.getJSON(Helpers.toServicesUrl("/GetctrlSecurityInfo"), { userName: WSIPCContext.UserName, districtId: WSIPCContext.DistrictId }, function (data) { options.success([]); kgSecurityGrid.dataSource.data(data.GetctrlSecurityInfoResult.RootResults); }).always(function () { kendo.ui.progress(kgSecurityGrid.element, false); }); }, update: function (options) { if (!(kgSecurityGrid)) { // options.success([]); // return; } kendo.ui.progress(kgSecurityGrid.element, true); $.postJSON(Helpers.toServicesUrl("/GetupdateSecurityInfo"), { userName: WSIPCContext.UserName, districtId: WSIPCContext.DistrictId, UserToUpdate: "wise\lhedman", Role: "Teacher", FnR: "yes", SpecEd: "yes", Assess: "yes", Discipline: "yes", Activites: "yes", MSDAdmin: "no" }, function (data) { options.success([]); // kgSecurityGrid.dataSource.data(data.GetupdateSecurityInfoResult.RootResults); }).always(function () { kendo.ui.progress(kgSecurityGrid.element, false); });// type: "POST" } }, sort: { field: "Username", dir: "asc" }, schema: { model: { fields: { Username: { type: "string", editable: false }, FreeReduced: { type: "string" }, SpedEd: { type: "string" }, Discipline: { type: "string" }, Assessment: { type: "string" }, Activities: { type: "string" } } } }, pageSize: 15, batch: true, page: 1 }, pageable: true, sortable: true, groupable: true, filterable: true, resizable: true, height: 760, toolbar: ["create", "save", "cancel"], editable: true }).data("kendoGrid"); $("#applyFilters").css('display', 'none'); kgSecurityGrid.dataSource.read(); }; //end of initelements //ACTIONS var index = function () { }; // var visitNodes = function (nodes, callback) { for (var i = 0; i < nodes.length; i++) { callback(nodes[i]); if (nodes[i].hasChildren) visitNodes(nodes[i].children.view(), callback) } }; var eachItemToJSON = function (items) { var result = new Array(items.length); for (var i = 0; i < items.length; i++) result[i] = items[i].toJSON(); return result; }; function onInitialLoad() { // $("#applyFilters").trigger("click"); }; //CALL CONSTRUCTOR init(); // init1(); //PUBLIC PROPERTIES return { index: index };});