NumericTextBox in a MVC project

9 posts, 0 answers
  1. Allan
    Allan avatar
    5 posts
    Member since:
    Dec 2011

    Posted 17 Dec 2011 Link to this post

    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
  2. TazDeveloper
    TazDeveloper avatar
    18 posts
    Member since:
    Feb 2010

    Posted 20 Dec 2011 Link to this post

    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? 
  3. Kendo UI is VS 2017 Ready
  4. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 20 Dec 2011 Link to this post

    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!
  5. TazDeveloper
    TazDeveloper avatar
    18 posts
    Member since:
    Feb 2010

    Posted 20 Dec 2011 Link to this post

    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"/>

  6. TazDeveloper
    TazDeveloper avatar
    18 posts
    Member since:
    Feb 2010

    Posted 20 Dec 2011 Link to this post

    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
  7. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 21 Dec 2011 Link to this post

    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!
  8. TazDeveloper
    TazDeveloper avatar
    18 posts
    Member since:
    Feb 2010

    Posted 21 Dec 2011 Link to this post

    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
  9. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 22 Dec 2011 Link to this post

    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!
  10. TazDeveloper
    TazDeveloper avatar
    18 posts
    Member since:
    Feb 2010

    Posted 22 Dec 2011 Link to this post

    Thank you!  Everything is working great now.

    Cheers,
            Paul
Back to Top
Kendo UI is VS 2017 Ready