Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9157685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:05:02+00:00 2026-06-17T13:05:02+00:00

I am using Meteor 0.5.4 I have just encountered a strange issue with Meteor’s

  • 0

I am using Meteor 0.5.4 I have just encountered a strange issue with Meteor’s Session.set().

I want to show a simple modal dialogue when user clicks on a template instance.

I am using Template’s event map to set some info into Session when user clicks onto a Template instance.

Template.Orders.events({
'click' : function () {
    Session.set("OrderName", this.name);
}
});

Modal dialogue template then displays the data set in Session:

Template.OrderDialogue.OrderName = function() {
    return Session.get("OrderName");
}

and finally here’s my JQuery code

Template.Orders.rendered = function() {
    jQuery('a[rel*=leanModal]').leanModal();
}

When I use Session.set() – as showed above inside Template.orders’s click event handler – JQuery plugin doesn’t show the modal dialogue on the first click on the template instance but only on second click on that exact instance. It takes two clicks on template instance to get the modal dialogue.

When I remove Session.set() everything is working fine – modal dialogue is shown on first click as it’s supposed to work.

Debug output shows that Session value is properly set on the first click.

How can Session.set() interfere with my JQuery plugin?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:05:03+00:00Added an answer on June 17, 2026 at 1:05 pm

    leanModal is showing the HTML content of OrderDialogue before the Meteor engine reactively infuses the new content into it, so the key is to wrap the leanModal click in a setTimeout to ensure the reactivity has happened.

    Assuming you have:

    <template name="OrderDialogue">
        <div id="overlay_content">
           <h1>{{OrderName}}</h1>
        </div>
    </template>
    
    <template name="Orders">
        {{#each order}}
            <a href="#overlay_content" rel="leanModal">{{name}}</a>
        {{/each}}
    </template>
    

    And your javascript:

    Template.Orders.events({
       'click' : function () {
          Session.set("OrderName", this.name);
       }
    });
    
    Template.OrderDialogue.OrderName = function() {
       return Session.get("OrderName");
    }
    
    Template.Orders.rendered = function() {
       $("a[rel*=leanModal]").leanModal();
    }
    

    Then you have to hack the leanmodal widget with a setTimeout on the click event handler, to give the reactivity a moment to render the OrderName content prior to event bubbling.

    Assuming this is the script, wrap the click handler in this script (starting around line 23) like this:

    $(this).click(function(e) {
        setTimeout(function() {
            var modal_id = $(this).attr("href");
            ...
        }, 1);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple (yet somehow convoluted) issue. Basically I'm adding items to make
I am using Meteor, Handlebars, and Backbone to create a multipage application. I have
I have started a meteor application using the accounts packages for facebook, twitter, github
I have three simple Templates in Meteor, and a Collection on the server with
I just started using meteor today and can't seem to figure out what I'm
I have an autocomplete textbox function which I am using in meteor. It works
I am using Meteor and the jquery data table library. I have a table
I have a strange situation with my web service. It is a simple one
I want to create a messaging app in Meteor (using the auth branch). It
I'm building a simple drawing app using the new Meteor.js app platform and paper.js.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.