jQWidgets Forums

jQuery UI Widgets Forums Navigation Tree Glyphicon in jqxTree

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  ivailo 10 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Glyphicon in jqxTree #70780

    SumitRoy
    Participant

    Hello Sir,
    is there any way to add icon using bootstrap glyphicon in jqxTree. In my code when I write

    var elementByID = $('#jqxTree').find("#2")[0];
    var data={ icon:"glyphicon glyphicon-cog",html: "<span style='font-weight: bold;' id='myItem'>Hi <input type='checkbox' /></span>" };
    $('#jqxTree').jqxTree('addTo', data, elementByID);

    screenshots

    Can you please tell me sir how can I add glyphicons to it.

    Glyphicon in jqxTree #70785

    ivailo
    Participant

    Hi SumitRoy,

    In your code the icon property is asociated to glyphicon, but the requirement is to be an image. Cause of this the widget is searching unexisted image, an that explains the error in your screenshot.

    So you have two options:
    1. Usage of images (as is presented in our examples).
    2. Including the glyphicons in into the HTML part – <span class=”glyphicon glyphicon-cog” aria-hidden=”true”></span>

    The result code must be:

    var elementByID = $('#jqxTree').find("#2")[0];
    var data={html: "<span class='glyphicon glyphicon-cog' aria-hidden='true'></span><span style='font-weight: bold;' id='myItem'>Hi <input type='checkbox' /></span>" };
    $('#jqxTree').jqxTree('addTo', data, elementByID);

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.