EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: rickmus on April 16, 2018, 09:50:55 AM



Title: Badge Documentation
Post by: rickmus on April 16, 2018, 09:50:55 AM
Hello, I am unable to find any documentation on badges.  Specifically how to update and whether or not they will display a zero ( or how to turn on/off in that case ).

Thanks!


Title: Re: Badge Documentation
Post by: jarry on April 16, 2018, 06:40:08 PM
The Badge is an element with class set to 'm-badge'. A button with a badge is defined as:
Code:
<a id="btn" href="#" class="easyui-linkbutton" style="margin-left:20px">
    Button<span class="m-badge">5</span>
</a>
To update the badge you should update the button's text value.
Code:
$('#btn').linkbutton({
  text: 'Button<span class=m-badge>2</span>'
});