As the name says. I want to create a TooltipDialog after I click on the link and load the custom content into this dialog box. The tooltip body is a complete placeholder, I just did not do any server logic to handle this. So far I have come to this:
PreviewThread: function (ThreadID) {
var tooltip = new dijit.TooltipDialog({
href: "/Account/SingIn?ReturnUrl=" + Jaxi.CurrentLocation
});
},
<a href="javascript:Jaxi.PreviewThread(@thread.ThreadID)" class="preview-thread" id="@tp.ToString()">Preview</a>
It’s not even about how to load content into a dialog, but how to open it first?
After I encountered the error and trial and error, I finally got to this:
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 });
});
},
It works somehow. ToolTipDialog opens, but .. I have to double-click, and I can not close the dialog after clicking outside it or after the mouse.
Ok, let's start looking like dev log, but hopefully this will save others, some headchace:
I finally managed to open it where I want:
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) });
},
<a href="javascript:Jaxi.PreviewThread(@thread.ThreadID)" id="@tp.ToString()" >Click Me</a>
, Asp.NET MVC.
.