Note that there are some explanatory texts on larger screens.

plurals
  1. PODojo - How to programatically create ToolTip Dialog on link click
    primarykey
    data
    text
    <p>As the title says. I want to create TooltipDialog, after I click link and load custom content into that dialog. The tooltip body is complete placeholder, I just haven't done any server logic to handle this. So far i got to this point:</p> <pre><code> PreviewThread: function (ThreadID) { var tooltip = new dijit.TooltipDialog({ href: "/Account/SingIn?ReturnUrl=" + Jaxi.CurrentLocation }); }, &lt;a href="javascript:Jaxi.PreviewThread(@thread.ThreadID)" class="preview-thread" id="@tp.ToString()"&gt;Preview&lt;/a&gt; </code></pre> <p>The point is not even how to load content, into dialog, but how to open it in the first place ?</p> <p>After more googling and trial &amp; error I finally got to this:</p> <pre><code> PreviewThread: function (ThreadID) { var tooltip = new dijit.TooltipDialog({ href: "/Account/SingIn?ReturnUrl=" + Jaxi.CurrentLocation, closable: true }); dojo.query(".thread-preview").connect("onclick", function () { dijit.popup.open({ popup: tooltip, around: this }); }); }, </code></pre> <p>It's somehow working. ToolTipDialog opens, but.. I have to click twice and and I can't close dialog after click outside it, or after mouseleave.</p> <p>Ok this, going to start look like dev log, but hopefully it will save others some headchace:</p> <p>I finally managed to popup it where I want to:</p> <pre><code> PreviewThread: function (ThreadID) { var tooltip = new dijit.TooltipDialog({ href: "/Account/SingIn?ReturnUrl=" + Jaxi.CurrentLocation, closable: true }); dijit.popup.open({ popup: tooltip, around: dojo.byId("thread-preview-" + ThreadID) }); }, &lt;a href="javascript:Jaxi.PreviewThread(@thread.ThreadID)" id="@tp.ToString()" &gt;Click Me&lt;/a&gt; </code></pre> <p>Note that I'm using Asp .NET MVC. Now only thing left is to close damn thing in user friendly manner..</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload