Template.myPictures.onRendered(function () {
// Use the Packery jQuery plugin
this.$('.container').packery({
itemSelector: '.item',
gutter: 10
});
});
…I added this code to one of my Template .js files:
Template.jobLocs.onRendered(function () {
if (Session.equals("schedulerId", "undefined")) {
alert('Before saving any Jobs/Locations data, you must first log in.')
}
});
But I get an err msg in the console, “Uncaught TypeError: Cannot read property ‘onRendered’ of undefined”
Now it went away; I wanted to put a breakpoint in CDT in that template.js, but it doesn’t show up in CDT’s Sources list under my Templates folder (which is where the .js file exists)…
CDT’s source pane shows a “Templates” folder, but it contains the .js file from client\main.js; I also have a client\templates folder, and those .js files do not show up in CDT for some reason.
Even when I have put things into the template, I’m getting the same error. I dont plan on using the template for anything other than loading a dataset from a massive .csv file from my server to the client. I originally set it “Template.body.onRendered(loadloinc())” but the body gave me even more trouble.
Quite hard to “guess” your code based on incomplete pasted snippets, no file structure to check imports, etc. Could you please create a minimal git repository reproducing your problem so that people can try to help you?