badge

Introduced in Q1 2013 SP Sets a badge on one of the ButtonGroup buttons with the specified value. If invoked without parameters, returns the button's current badge value. Set the value to false to remove the badge.

Parameters

button Selector|Number

The target button specified either as a jQuery selector/object or as an button index.

value String|Boolean

The target value to be set or false to be removed.

Returns

String|kendo.mobile.ui.Button the badge value if invoked without parameters, otherwise the ButtonGroup object.

Example

<div data-role="view" data-init="setBadges">
  <ul id="buttongroup" data-role="buttongroup">
    <li>Option 1</li>
    <li>Option 2</li>
    <li>Option 3</li>
  </ul>
</div>

<script>
var app = new kendo.mobile.Application();

function setBadges() {
  var buttongroup = $("#buttongroup").data("kendoMobileButtonGroup");

  // Set the first button badge value to 5
  buttongroup.badge(0, 5);
  // Set the last button badge value to 10
  buttongroup.badge("li:last", 10);
  // Get the current badge value on the first button.
  console.log(buttongroup.badge(0));
  // Remove the first button badge
  buttongroup.badge("li:first", false);
}
</script>
In this article
Not finding the help you need?