We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

I wanna add a tooltip to a dialogs

Thread ID:

Created:

Updated:

Platform:

Replies:

129820 Apr 5,2017 05:37 AM Apr 10,2017 06:03 AM ASP.NET Web Forms 3
loading
Tags: Tooltip
Carsten Wuttke
Asked On April 5, 2017 05:37 AM

Hello,

i have several code-generated dialogs on a webpage. Each dialog has its unique id. And there is a possibility, that some stuff on the dialog needs a tooltip as explanation. Well. Tried to add the tooltip with only the tag "Target". Didn't work. I can't use for as the dialogs have different IDs. And as far as I understand the tag "For" is for a single ID.
Then I tried to add the Tooltip to each dialog with this basic code:
          Syncfusion.JavaScript.Web.Tooltip tt = new Syncfusion.JavaScript.Web.Tooltip();
            tt.Content = "ToolTipText";
            tt.Target = ".custom";

            tt.For = dialog.ID;
            tt.ID = dialog.ID + "_tt";
            tt.Width = "180px";
            dialog.DialogContent.Controls.Add(tt);

Well. If I put "For" after "ID" it destroys the dialog. And in the webpage it looks like this in the source:

$("#node_5_popup_tt").ejTooltip({"width":"180px","content":"ToolTipText","target":".custom","clientId":"node_5_popup_tt","uniqueId":"ctl00$MainContent$node_5_popup$node_5_popup_tt"});

There I'm missing the "For". What am I missing?


Prince Oliver [Syncfusion]
Replied On April 6, 2017 07:50 AM

Hi Carsten,   
  
Thank you for contacting Syncfusion support.   
  
The Target attribute is used to specify a selector for the tooltip within the container element. So, it will not work for the other element outside the container. Tooltip will be rendered upon an existing element, hence For attribute is used for specifying the ID of the existing container element which in you case is dialog control.   
  
Render the tooltip control in aspx page and access its object in the code behind as follows   
  
[aspx]   
<ej:Dialog ID="basicDialog" Content=".control" runat="server"  ClientIDMode="Static" Title="Audi Q3 Drive" > 
</ej:Dialog> 
        <ej:Tooltip ID="tooltip1" runat="server" ClientIDMode="Static" ></ej:Tooltip> 


[aspx.cs] 
protected void Page_Load(object sender, EventArgs e) 
        { 
            tooltip1.Content = "ToolTipText"; 
            tooltip1.For = basicDialog.ID; 
            tooltip1.Width = "180px"; 
        } 


We have prepared a sample as per your requirement, kindly refer to the following link for the sample: http://www.syncfusion.com/downloads/support/forum/129820/ze/DialogWithTooltip-588936302 
   
Regards, 
Prince 


Carsten Wuttke
Replied On April 7, 2017 02:28 AM

Hello Prince,
thx for your reply. But I can't set it in the page. I have to create it by code. Why you ask? Well. Currently I have 10 dialogs (code-generated) that could need a tooltip. But tomorrow someone changes the data that generates the dialogs and there are 20. Then the tooltip should also be generated automatically if needed. And each dialog has a unique ID.


Prince Oliver [Syncfusion]
Replied On April 10, 2017 06:03 AM

Hi Carsten,    

Thank you for your update. 

As per your requirement, you can use a single tooltip to show content based on the dialog for every dialog control. This can be done using target property.  We need to include a common class for dialogs using cssClass property of dialog and set it to target property in tooltip control. This will display tooltip for every dialog control.    

We have prepared a sample, kindly refer to the following link for sample:  http://www.syncfusion.com/downloads/support/forum/129820/ze/DialogWithTooltip-824925310 

Regards, 
Prince 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;