Below is my code for dropdown menu …
This dropdown menu is on navigation side.
So i want to render on this url → /iotdevice-Management after select any value from dropdown.
I am attaching on screenshot for review…
‘change #selectroomlist’: function(e) {
e.preventDefault();
roomDevcollection = ;
var selectedrooms = $(“#selectroomlist”).val();
console.log(selectedrooms,“selected rooms”);
Session.set(“selectedrooms”,selectedrooms);
var roomDevice = DeviceSchema.find({ roomId: Session.get(‘selectedrooms’) }).fetch();
for(var iter = 0; iter < roomDevice.length; iter++){
roomDevcollection.push(roomDevice[iter].deviceName);
}
Session.set(‘roomDevcollection’,roomDevcollection);
console.log(roomDevcollection,“total added device”);
console.log(Template[“Iotdevicemanagement”],“asdasdasdasdasda”);
var userID = Meteor.userId();
Router.go(‘Iotdevicemanagement’,{_id: selectedrooms});
}
as you can see there is one dropdown at top left corner , so i want to render on same url when we select value from dropdon .
Because coding for circuit diagram in the image executes on render.
Plz help me out Thanks.
What you want is to redo your image (btw, why is it an image?) if the variable changes. That means using a Tracker.autorun (or this.autorun when in the onRendered hook) to redo the image.
Doing so this way will make sure you recreate the image everytime a reactive source changes, which is the meteor’s most wonderful magic.