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

OnLoad ClientEvent not registering

1 Answer 18 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Top achievements
Rank 1
James asked on 30 Nov 2011, 10:22 PM
I've recently upgraded to the Q3 2011 release, and I've noticed that this client event is no longer registering.  This was working prior to upgrading.  Here is my grid markup:

    .Columns(column =>
          column.Template(@<text><input type="checkbox" name="checkedRecords" class="value-checkbox" value="@item.ProductId" /></text>)
                   .HtmlAttributes(new { @style = "text-align: center;" })
                   .HtmlAttributes(new { @id = "column_ProductId" })
                   .HeaderTemplate("<input type='checkbox' id='checkbox-select-all' style='text-align: center; margin-left: 11px;' />");
        column.Bound("FullDescription").Title("Full Description").Width(150);
        column.Bound("IsInactive").Title("Is Inactive").Width(150);
    .Scrollable(scroll => scroll.Height(500))
    .ClientEvents(events => events.OnLoad("grid_OnLoad"))
    .NoRecordsTemplate("Please enter a search term to begin.")

Here is the Javascript:

function grid_OnLoad() {
    alert('grid loaded');
    // other JS code to respond to a row click to check the checkbox, and a double-click to open a new window with selected details

As it stands right now, when the page loads and the grid renders, I get no alert().  I added that to verify that the event was registering because I lost the ability to click on a row to select the checkbox, as well as the ability to double-click on the row to open a new window.  The only thing that has changed between now and then is the upgrade to Q3 2011.

I can provide an example project if you'd like, but I'm not sure when I'll get time as I have a lot on my plate.  I noticed this during some regular testing.  Thanks.


EDIT: Also want to add that my header checkbox is also no longer centering when it was before, but that's a very small issue I can worry about myself.  Just wanted to add it in case it was an "unintended feature" of the new release.  :)

1 Answer, 1 is accepted

Sort by
Top achievements
Rank 1
answered on 01 Dec 2011, 07:53 PM
Issue resolved.  The Q3 2011 release is using jQuery 1.6.2, and I was using jQuery 1.5.1, so I disabled loading jQuery in my ScriptRegistrar and now everything is working again.  Can't keep up with all these new version of jQuery.  :)
Asked by
Top achievements
Rank 1
Answers by
Top achievements
Rank 1
Share this question