user3207455
user3207455

Reputation: 73

Kendo MaskedTextBox data attributes

Can MaskedTextBox be configured via data attributes?

I tried the following but did not work.

<input data-role='kendo.ui.MaskedTextBox' data-mask='(999) 000-0000' />

Thanks.

Upvotes: 0

Views: 2063

Answers (1)

Lars H&#246;ppner
Lars H&#246;ppner

Reputation: 18402

It can; are you sure you're instructing Kendo UI to initialize the DOM elements (either by calling kendo.init or by binding a view model)? Both of these work:

<div id="example">
    <input data-role="maskedtextbox" data-mask="(999) 000-0000" />
    <input data-role="kendo.ui.MaskedTextBox" data-mask="(999) 000-0000" />
</div>

$(function() {
    kendo.init($("#example"));
});

(demo)

Upvotes: 1

Related Questions