This is a migrated thread and some comments may be shown as answers.
ClientEvents OnDataBound not firing on multiple grids
3 Answers 74 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.
Jack
Top achievements
Rank 1
Jack asked on 09 Dec 2010, 04:05 PM
I have 2 grids on the same page, on for completed downloads and one for in progress. For some reason the client events do not fire, below are my 2 grids:
    <%
    Html.Telerik().Grid(Model.ViewerCompletedList)
        .Name("CompletedUploads")
        .DataKeys(dataKeys => dataKeys.Add(p => p.TechnicalKey))
        .DataBinding(dataBinding => dataBinding.Ajax().Select("AjaxPortableBinding", "Viewer"))
        .Columns(columns =>
                      {
                          columns.Bound(f => f.FileName).Title(Resource.AA_Index_Grid_Filename);
                          columns.Bound(f => f.Name).Title(Resource.AA_Index_Grid_Device);
                          columns.Bound(f => f.StatusText).Title(Resource.AA_Index_Grid_Status);
                          columns.Bound(f => f.StartDisplayDate).Title(Resource.AA_Detail_Job_Start);
                          columns.Bound(f => f.TechnicalKey).Format(
                                    "<select onChange='ViewerFileAction(this)'>" +
                                    "<option value='{0}'>"+ Resource.File_Grid_Select +"</option>" +
                                    "<option value='delete'>"+ Resource.File_Grid_Delete +"</option>" +
                                    "<option value='aview'>"+ Resource.File_Grid_View +"</option>" +
                                    "<option value='save'>"+ Resource.File_Grid_Save +"</option></select>").Encoded(false).Title(" ");
                    })
        .ClientEvents(config => config.OnDataBound("showNoDataText"))
        .Pageable()
        .Sortable()
        .HtmlAttributes(new { @class = "content_table" })
        .Render();
        %>

and

    <%
    Html.Telerik().Grid(Model.ViewerParsingList)
        .Name("UncompletedUploads")
        .DataKeys(dataKeys => dataKeys.Add(p => p.TechnicalKey))
        .DataBinding(dataBinding => dataBinding.Ajax().Select("AjaxUnCompletedUploadsBinding", "Viewer"))
        .Columns(columns =>
                      {
                          columns.Bound(f => f.FileName).Title(Resource.AA_Index_Grid_Filename);
                          columns.Bound(f => f.Name).Title(Resource.AA_Index_Grid_Device);
                          columns.Bound(f => f.StatusText).Title(Resource.AA_Index_Grid_Status);
                          columns.Bound(f => f.TechnicalKey).Format(
                                    "<select onChange='ViewerFileAction(this)'>" +
                                    "<option value='{0}'>"+ Resource.File_Grid_Select +"</option>" +
                                    "<option value='delete'>"+ Resource.File_Grid_Delete +"</option>" +
                                    "<option value='aview'>"+ Resource.File_Grid_View +"</option>" +
                                    "<option value='save'>"+ Resource.File_Grid_Save +"</option></select>").Encoded(false).Title(" ");
                    })
        .ClientEvents(events => events.OnDataBound("displayInProgress"))                    
        .Pageable()
        .Sortable()
        .HtmlAttributes(new { @class = "content_table" })
        .Render();
        %>
I can see in Firebug that the first javascript call is made to:showNoDataText but the second one to displayInProgress is never reached. Any help please?

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 09 Dec 2010, 04:35 PM
Hi Jack,

I suspect that the described behavior is caused by a javascript error. Therefore, please verify that there are no javascript errors on the page. If you continue to experiencing difficulties,  you should consider sending us a small runnable project, in which the described behavior can be observed.

Regards,
Rosen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jack
Top achievements
Rank 1
answered on 09 Dec 2010, 06:01 PM
I could not find any js errors.
0
Rosen
Telerik team
answered on 10 Dec 2010, 08:35 AM
Jack,

I suspect that behavior you are observing is due to the fact that your project is not correctly configured to work with Telerik Extensions for ASP.NET MVC. Please refer to this help article for more information.

Regards,
Rosen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Jack
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Jack
Top achievements
Rank 1
Share this question
or