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

NumericTextBox in a MVC project

8 Answers 165 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
Allan
Top achievements
Rank 1
Allan asked on 18 Dec 2011, 12:52 AM
Hi
I can't get the NumericTextBox to work in my MVC project.
When I increase or decrease the number, the field loose its focus and show the formattet result.
It seams that the problem is the absolute reference with the css and js files. When I test the code in a local directory with relative references to css and js, everything works. But not from my MVC project.
I have tried the MVC extensions from codeplex.com, and it seams that they also have the same problem.
Any help?
Allan

8 Answers, 1 is accepted

Sort by
0
TazDeveloper
Top achievements
Rank 1
answered on 20 Dec 2011, 12:52 PM
I'm having the same issue using the NumericTextBox in an MVC project.  It works fine in a standalone page, but when running in my mvc project, the enable function is bombing.  Visual Studio is breaking in kendo.numerictextbox.js line 213 with an error stating "Object doesn't support this property or method"

Anyone know why? 
0
Georgi Krustev
Telerik team
answered on 20 Dec 2011, 01:05 PM
Hello Tazdeveloper,

 
This is not a known issue. Could you send us the current implementation? Thus I will be able to review it and advice you further.

All the best,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
TazDeveloper
Top achievements
Rank 1
answered on 20 Dec 2011, 02:21 PM
Unfortunately, I think the MVC Project is not the real problem.  I have been working on this and the NumerictextBox works in Firefox and Chrome just fine.  The issue seems to be specific to IE.  I am using IE8 and when the code runs there is a definite error in the exact location listed in my earlier post.  It does not appear in Firefox or Chrome.  If I place this code in an HTML file and open it directly in the browser it works fine in IE8.  When in the project it dies at the location listed.

What would be the difference between opening an HTML file from the local disk and getting the page back from an mvc website?

I'm stumped.  I am fixing something else at the moment for work, but I will post a full example project a little later today.  Here are the code snippets from the page.

Cheers,
         Paul

<script type="text/javascript">
    $(document).ready(function () {
         
          
         ////////////////////////////////////////////////////////////////////////////////////////////////////
         // Number of Adults and Children
         ////////////////////////////////////////////////////////////////////////////////////////////////////
         $("#ADULTS").kendoNumericTextBox(
                     {
                         format: "#",
                         decimals: 0
 
                     });
 
         
 
    });
    </script>
 

<!-- AIR SEARCH -->
<input id="ADULTS" value="2" type="number" min="1" max="5" step="1"/>

0
TazDeveloper
Top achievements
Rank 1
answered on 20 Dec 2011, 05:15 PM
After further research, I have determined that my issue is not an MVC issue.  My MVC site loads different HTML templates for the site.  In one set of HTML the NumericTextBox works fine.  In another, it breaks.  It is however an IE issue.  All HTML versions work in Firefox and Chrome.

I am going to research my HTML and CSS styles to figure out whats wrong.  I will post anything I find in a new thread since it is not related to my MVC project.

Cheers,
        Paul
0
Georgi Krustev
Telerik team
answered on 21 Dec 2011, 06:22 PM
Hello Paul,

 
I have answered to the suported ticket opened on the same matter. Here is a quote of the answer:

Thank you for pointing this issue to us. There was a typo in the enable method of the numerictextbox widget:

enable: function(enable) {
            var that = this,
                text = that._text,
                element = that.element;
                wrapper = that._inputWrapper,
                upArrow = that._upArrow,
                downArrow = that._downArrow;
....

It should be like this:
enable: function(enable) {
            var that = this,
                text = that._text,
                element = that.element,
                wrapper = that._inputWrapper,
                upArrow = that._upArrow,
                downArrow = that._downArrow;

I have attached the modified kendo.all.min.js file.

As a gratitude for your involvement I have updated your Telerik points.


Best wishes,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
TazDeveloper
Top achievements
Rank 1
answered on 22 Dec 2011, 01:13 AM
Hi Georgi,

Thanks for the reply.  I just got done checking the file you gave me and updating my files with the fix, and neither worked.  Both ways produces a missing ; error when you try to run.  I updated my support ticket.

One question, though...

What happens now that you find a bug and apply a fix like this?  Are the downloads from the account page updated?  Should I apply the fix provided, or get the whole download again?  

Thanks for the support!

Cheers,
         Paul
0
Georgi Krustev
Telerik team
answered on 22 Dec 2011, 09:59 AM
Hello,

 The fix provided in my previos message is the right one. Please note that it should not be applied directly to the minified file, as this will broke it. You can apply the fix to the non-minified JS file and then minify it using uglify-js or other minification tool.

As to the fixes, they will be available in the next internal build, which is available only for customers. I will suggest you continue our discussion in the support ticket in order to avoid any duplication.

Greetings,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
TazDeveloper
Top achievements
Rank 1
answered on 22 Dec 2011, 11:13 AM
Thank you!  Everything is working great now.

Cheers,
        Paul
Tags
NumericTextBox
Asked by
Allan
Top achievements
Rank 1
Answers by
TazDeveloper
Top achievements
Rank 1
Georgi Krustev
Telerik team
Share this question
or