Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

How do I add badges to buttons?

Hi Adam,

Sorry, not sure I understand. What do you mean by 'make the class visible'?

To increment badge you can store a value in localStorage, and then use it:prevar myValue= parseInt(localStorage.getItem("myValue"));
$("[name=mobilenavbaritem_118]").before('span class="badge"'+myValue+'/span');
localStorage.setItem("myValue", myValue + 1);/pre

adam griffin
Posts: 0
Joined: Tue May 21, 2013 8:44 pm

How do I add badges to buttons?

By default the class display is none. I would like to make it change from none to shown using javascript when clicking a button or from a list service success

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

How do I add badges to buttons?

Hello Adam,

You may use this JS for display:

code$(".badge").css("display","block");
такой чтоб скрыть:
$(".badge").css("display","none"); /code

adam griffin
Posts: 0
Joined: Tue May 21, 2013 8:44 pm

How do I add badges to buttons?

The badge is not adding.Instead it is just placing beside each other also its not adding to the badge number Image Image

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

How do I add badges to buttons?

Adam,

Please clarify, how do you add this text in badge. Please try like this:

code$(".badge").html("5");/code

She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

How do I add badges to buttons?

Hi Evgene,
this badge is possible in button component?

Thank you.

She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

How do I add badges to buttons?

i used this
//badge
$("[name=btnTodayAtt]").parent().addClass("ui-badge-container");
$("[name=btnTodayAtt]").before('span class="badge"4/span');
$(".badge").css("display","block");

then the output looks like this, the badge is in the grid. i want the badge will post in the TODAYS Attendance Button Screnshot:

https://d2r1vs3d9006ap.cloudfront.net...

Thank you

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

How do I add badges to buttons?

Hello She,

I suppose you should use position scc rule to display it where you want. Please look at the first Yurii's reply, I think this is what you need.

Return to “Issues”