I have a visual perspective set up with multiple content panels displaying queries.
To clear clutter, I would like to completely hide the queries which do not display any records.
I've been trying out render scripts on the content panels but it is not working.
The error I am getting is: Exception running render script for panel BAS_FRAME_main_HTMA_Request_Panel2 TypeError: Cannot read properties of undefined (reading 'wrapperId')
Code: Select all
var grid = $("#" + parser.m_widgetInfo.wrapperId).find(".k-grid").data("kendoGrid");
console.log("grid found");
grid.bind("dataBound", expand);
console.log("script end");
function expand(e) {
console.log("enter function");
console.log(grid.dataSource.total());
if (grid.dataSource.total() == 0 ){
//Hide grid
console.log("total empty");
$(grid).hide();
}
else{
//Show grid
console.log("total visible");
$(grid).show();
}
}