Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7543641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:28:48+00:00 2026-05-30T08:28:48+00:00

I have a page in MVC3 using a Telerik grid. In the grid, for

  • 0

I have a page in MVC3 using a Telerik grid. In the grid, for each row, is a textbox that I’m entering an decimal. I have a css class, ‘HoursNew’, which is used to connect a jQuery plugin ( autoNumeric.js ). I also have an onBlur function to round any decimal input to the nearest half decimal.
Problem is, after sorting a column, all JavaScript seems to stop working. The autoNumeric.js stops working along with the function I have that fires onBlur.

    $(document).ready(function () {
    $('.HoursNew').autoNumeric({ pSign: 's', vMin: '-999.5', vMax: '999.5', mRound: 'C', aPad: false });
    $('.HoursNew').blur(function () { roundToHalf(this); });
});

            // Round decimal to nearest .5
            // v is input object
            function roundToHalf(v) {
                var value = v.value;
                var r;
                //alert(v.id);
                var converted = parseFloat(value); // Make sure we have a number
                var decimal = (converted - parseInt(converted, 10)); // Pull the decimal value
                decimal = Math.round(decimal * 10);
                if (decimal == 5) { return (parseInt(converted, 10) + 0.5); } // leave alone if .5
                if ((decimal < 3) || (decimal > 7)) {
                    r = Math.round(converted); // Round up or down to nearest whole number
                } else {
                    r = (parseInt(converted, 10) + 0.5); //round to .5
                }
                //alert(r);
                // reset input value to new value
                $('#' + v.id).val(r);
            }

Page works fine on first load, just this problem after a sort. Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:28:50+00:00Added an answer on May 30, 2026 at 8:28 am

    I have a hunch that when sorting, the grid is making an ajax call that renders a new grid. What this means is that any bindings you performed in $(document).ready are removed.

    Take a look at this page on client-side events in the Telerik documentation. You’ll need to add this section to your grid definition:

    .ClientEvents(events => events
        .OnDataBound("onDataBound")
    

    And this javascript to rebind:

    function onDataBound(e) {
        $('.HoursNew').autoNumeric({ pSign: 's', vMin: '-999.5', vMax: '999.5', mRound: 'C', aPad: false });
        $('.HoursNew').blur(function () { roundToHalf(this); });
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have develop small Asp.net MVC3 application using Telerik rad Controls with in that
I am using MVC3, in which I have a page let say Home.cshtml with
I'm using MVC3 with Razor. I have the following helper: public static class ImageActionLinkHelper
MVC3 and using the Telerik Grid. I'm using Phil Haacks Hidden Indexer Input For
I have a page in asp.net MVC3 project. The page has 3 divs, each
Using VB.NET with MVC3 and Razor. I have a test page for a custom
Here's the problem: 1.) We have page here... www.blah.com/mypage.html 2.) That page requests a
I have a page that is generated which inserts an HTML comment near the
I have a page using <ul> lists for navigation (Javascript changes the styling to
I have a page with a Google Maps mashup that has pushpins that are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.