Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 78072

Unable to set widget in template by classname

$
0
0

Hello there

Maybe this is a known problem, I couldn't find this case in the Internet / forum here. I want to bind a MaskedTextBox Widget to a HTML element: 

<input id="numbertest" value="555" class="numericBox" />

The id element "numbertest" is not available after loading the page. Thats why I added a class to the id element so it will be affected as soon as it is created. The id element is part of a Kendo UI template. In the ready function I added therefore:

$(".numericBox").kendoMaskedTextBox({
mask: "000"
});

And of course I need a valid class in the header:

.numericBox {
font-size: 20px;
}

Now the weird behaviour: The font size inside the element numbertest is set to 20 when the template is created but its not a MaskedTextBox (I can enter anything). To be sure its not only a MaskedTextBox problem I also tried to attach a NumericTextBox but that also wont work. Thats why I think its a general problem. I can only make it work when creating the numbertest element before the ready function is called. Then I'm able to bind the element numbertest to a MaskedTextBox by classname (and of course directly by accessing it by $("#numericBox"). ...

 So my question: Is there a way to attach a Widget to a html element even if its not created after page is loaded (but later on by f.e. a Kendo UI template)?

Regards


Viewing all articles
Browse latest Browse all 78072

Trending Articles