This is a migrated thread and some comments may be shown as answers.

[Solved] $.telerik.textbox not loading.

2 Answers 125 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Emmanuel
Top achievements
Rank 1
Emmanuel asked on 27 Apr 2011, 08:24 PM
Hi
I am trying to use the javascript function $.telerik.textbox.formatNumber(...)
I am able to use it when I have controls using Html.Telerik().CurrencyTextBoxFor(model => model.PropertyA)
BUT
when I use Html.Telerik().CurrencyTextBox(Model.Something)
the function is not availible.

I read in other forum posts that the javascript files loaded from Telerik controls are only availible when the controls need them (Which makes sense) but it seems that using CurrencyTextBox(...) and CurrencyTextBoxFor(..) does not load the same javascript files.

I even looked through the DOM using Firebug and the object $.telerik.textbox isn't even created.

Is there a manual way to load the files so that I can use $.telerik.textbox.formatNumber(...) ?

2 Answers, 1 is accepted

Sort by
0
nachid
Top achievements
Rank 1
answered on 27 Apr 2011, 10:53 PM
From where you get the idea of using Html.Telerik().CurrencyTextBox() this way?
This contructor function does not accept any parameter.
Its counterpart Html.Telerik().CurrencyTextBoxFor accepts an expression

It is the same for all MVC Telerik components
Html.Telerik().ComboBox() vs Html.Telerik().ComboBoxFor(expression)

Html.Telerik().DatePicker() vs Html.Telerik().DatePickerFor(expression)
0
Emmanuel
Top achievements
Rank 1
answered on 28 Apr 2011, 03:09 PM
Yes that is what I am using sorry for the confusion.
Turns out I was trying to use the javascript function before any of my controls were being loaded
<script>
// code using $.telerik.textbox.formatNumber(...)
</script>

<%= Html.Telerik().CurrencyTextBox().Name("Name") %>
 
If I load the script after one of the controls, the error goes away and the function becomes availible.
Tags
General Discussions
Asked by
Emmanuel
Top achievements
Rank 1
Answers by
nachid
Top achievements
Rank 1
Emmanuel
Top achievements
Rank 1
Share this question
or