This is a migrated thread and some comments may be shown as answers.

Runtime change tabstrip icons

3 Answers 163 Views
TabStrip (Mobile)
This is a migrated thread and some comments may be shown as answers.
Ralph
Top achievements
Rank 1
Ralph asked on 21 Mar 2013, 06:55 AM
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

3 Answers, 1 is accepted

Sort by
0
Kamen Bundev
Telerik team
answered on 25 Mar 2013, 11:32 AM
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!
0
Ralph
Top achievements
Rank 1
answered on 28 Mar 2013, 06:17 AM
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
0
Kamen Bundev
Telerik team
answered on 28 Mar 2013, 12:29 PM
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!
Tags
TabStrip (Mobile)
Asked by
Ralph
Top achievements
Rank 1
Answers by
Kamen Bundev
Telerik team
Ralph
Top achievements
Rank 1
Share this question
or