badge

Introduced in Q1 2013 SP Sets a badge on the Button with the specified value. If invoked without parameters, returns the current badge value. Set the value to false to remove the badge.

Parameters

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 Button object.

    <div id="foo" data-role="view">
      Foo
    </div>


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

    function countClicks() {
        var badge = parseInt(this.badge()); //get badge value
        badge++;
        this.badge(badge); //set new badge value
    }
    </script>
    <div data-role="view">
      Foo
      Remove badge
    </div>


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

    function removeBadge() {
      $("#btn").data("kendoMobileButton").badge(false);
    }
    </script>
In this article