This code,
View Page, Client Scripts:
$(document).on("rendertemplate", function(e, args) {
if (args.template) {
if (args.id == "tpd_<tablename>") { // with or without this check
args.enabled = false;
ew_ShowTemplates(args.template.substr(4));
}
}
});
Didn't work, threw the error:
Uncaught TypeError: Cannot read property 'substr' of undefined
console.log(args.template.substr(4)); // output: (mytablename)view