JavaScript UI Libraries & Blazor Components Suite – Smart UI Forums Tooltip create a tooltip template using jScript

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #108939

    hello — i cannot determine how to create a template in javascript.

    the template created in the example as ordinary HTML works fine (tooltip_1), but when i attempt to create a new template in javascript (tooltip_2), it does not work.

    i can even toggle this line:

    tmpTooltip.setAttribute('tooltip-template', 'newTemplate_2'); // newTemplate_1 works!

    so i know everything is working except for the creation of the template.

    you can see in the chrome-console that my newly created template is identical to the one that htmlelements created just using ordinary HTML.

    please let me know what i have done wrong in my example

    thank you very much.


    scratch question please – i realized that even if i managed to get this to work, using the template is too limiting.   if you wanted to put in line breaks or other css, i dont think this would work.



    When you create a template element js, you should put the children inside the content.
    Ex. tmpTemplate.content.appendChild(tmpDiv);

    Here is your demo now working:

    Best Regards,
    Svetoslav Borislavov

    Smart UI Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.