I have written detail expand function on index page and my kendo grid is on another page. my other functions are accessible but can't access detail expand and other functions related to kendo grid. need vb.net mvc code.
can anyone please help.
function detailExpand(e) { if (expandedRow != null && expandedRow[0] != e.masterRow[0]) { var grid = $('#drgdgrid').data('kendoGrid'); $(".k-master-row").each(function (index) { grid.expandRow(this); }); grid.collapseRow(expandedRow); expandedRow.next().remove(); } expandedRow = e.masterRow; //id = expandedRow[0].cells[0].innerText; var masterDataItem = $('#drgdgrid').data('kendoGrid').dataItem(expandedRow); expandedDataItem = masterDataItem; if (masterDataItem.code != null && masterDataItem.code != '') { $(".hideAddButton").hide(); } else { $(".hideAddButton").show(); } }
Hi, Sonali,
Functions that are related to the Kendo Components (such as event handlers, template functions, etc.) must be accessible from the global context.
My advice would be to create a separate myScripts.js file, have your custom JS logic in that file and then simply include it in your Layout so that the functions are accessible from every part of your project.
Let me know if you have any questions.
Best Regards,
Georgi