Runtime change tabstrip icons

4 posts, 0 answers
  1. Ralph
    Ralph avatar
    33 posts
    Member since:
    Oct 2012

    Posted 21 Mar 2013 Link to this post

    Hi,

    I would like to change the icon of a tabstrip element programmatically.
    I have done some research and found this link:
    http://www.kendoui.com/forums/mobile/listview/mobile-change-listview-data-icon.aspx

    However, when I try to apply it, it does not work.
    My code is as follow:

    var oldIcon = $('#messageViewLink').attr('data-icon');
    var newIcon = 'home';
    $('#messageViewLink').attr('data-icon', newIcon);
    $('#messageViewLink').find('.km-icon').addClass('km-' + newIcon).removeClass('km-' + oldIcon);

    More importantly, the following three statements return false:
        alert($('#messageViewLink').hasClass('km-icon'));
        alert($('#messageViewLink').hasClass('km-'+newIcon));
        alert($('#messageViewLink').hasClass('km-'+oldIcon));
        
    Please help. Thanks.

    BR,
    Ralph
  2. Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 25 Mar 2013 Link to this post

    Hi Ralph,

    Unfortunately I'm not able to decide what the issue is by just looking on the code you provided - what you are doing should be working okay. Can you post a sample page or a live URL to your app, so I can take a look and help you fix the issue? I can convert this thread to a support request if you prefer the privacy.

    Regards,
    Kamen Bundev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Ralph
    Ralph avatar
    33 posts
    Member since:
    Oct 2012

    Posted 28 Mar 2013 Link to this post

    Hi,

    Maybe just forget my code, how to change the tabstrip icon for a specific tab?
    We want to add a red dot on a tab when certain conditions are fulfilled (e.g. new messages arrived).

    Thanks.

    BR,
    Ralph
  5. Kamen Bundev
    Admin
    Kamen Bundev avatar
    1532 posts

    Posted 28 Mar 2013 Link to this post

    Hi Ralph,

    There's no need to change the icon - while not officially supported, there is badge styling in Kendo UI Mobile already. Check the jsBin example for more information (you will also need the additional CSS).

    All the best,
    Kamen Bundev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready