template String|Function

The template which renders the content of the badge.

Example - string template

<button>Button <span id="badge"></span></button>
<script>
    $('#badge').kendoBadge({
        data: {
            current: 2,
            total: 10
        },
        template: '#= current # of #= total #'
    });
</script>

Example - function template

<button>Button <span id="badge"></span></button>
<script>
    $('#badge').kendoBadge({
        text: 1234,
        template: function() {
            var text = this.options.text;
            return text > 99 ? 'A lot' : text;
        }
    });
</script>
In this article
Not finding the help you need? Improve this article