Change the Meteor Template Values on button click

Course Queries Syllabus Queries 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Syllabus Queries related to Course Queries. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago


I am displaying a list of Topics on a modal popup window, where on the modal I have two Buttons next and previous.I want When i click on the previous button it shows the previous 10 topics and when i click on the next button it shows the next 10 topics. My Template code is this

 class="modal fade">
 class="modal-dialog">
     class="modal-content">
         class="modal-header">
             class="modal-title" id="topic_selector_label">Quiz Settings
        
class="modal-body"> class="table table-striped table-bordered table-condensed table-hover " > {{#each topics}} {{name}} {{/each}} <button type="button" class="btn btn-default" id="previous_topics">Previous Topicsbutton> <button type="button" class="btn btn-default pull-right" id="next_topics">Next Topicsbutton>
class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Cancelbutton>

and my js code is

'click #next_topics':function(){

    var LIMIT=2;
    skip_topics=skip_topics+2;
    var syllabus = Meteor.syllabi.findOne(Session.get("currentSyllabusId"));
    topics= Meteor.topics.find({subject_id: syllabus.subject_id, level_id: syllabus.level_id},{skip:skip_topics,limit:1})
    return Template.syllabus_design({topics:topics})

},

I want to change the list of topics on next and previous button click

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

Important Course Queries Links