Change the Meteor Template Values on button click

Course Queries Syllabus Queries 3 years ago

9.85K 1 0 0 0

User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 3 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

0 views
0 shares

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.

Similar Forum


View All

Important Course Queries Links