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

[Solved] OnRowSelect not firing

3 Answers 236 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
John
Top achievements
Rank 1
John asked on 14 Oct 2010, 12:48 AM
So we updated to a new build where OnRowSelected became deprecated which had a bug in it causing a stack overflow so I changed it to OnRowSelect.  My issue now is that the function is no longer firing my javascript.

<% Html.Telerik()
    .Grid<DataViewModel>()
    .Name("bleh")
    .Columns(columns =>
    {
        columns.Template(s =>
        {%>
            <input type='checkbox' name='Selected' value='<%= s.ID %>' />
        <%})
        .ClientTemplate("<input type='checkbox' name='Selected' value='<#= ID #>' />")
        .Width(35).HtmlAttributes(new { style = "text-align:center" }).Title("<input type='checkbox' class='cbHeader'/>");
        columns.Bound(c => c.Name).Title("Header");
         
    })
    .DataBinding(db => db.Ajax().Select("Grid", "Data"))
    .ClientEvents(events =>
            events
            .OnRowSelect(() =>
            {
                %>
                function(e){
                    alert('foo');
                    $.triggerCommand('showData',null, {
                        ClassToShow: $(e.row).find(':checkbox').attr('value')
                    });
                }
                <%
            })
... more code

3 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 14 Oct 2010, 07:03 AM
Hello John,

 Is your grid Selectable()? This is the requirement to allow client-side selection. The OnRowSelect event seems to work ok in our online demos.

All the best,
Atanas Korchev
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
John
Top achievements
Rank 1
answered on 15 Oct 2010, 04:16 PM
Yes, my grid is selectable.  I am using a version 2010.2.825.235 dll if that makes a difference.

John
0
Atanas Korchev
Telerik team
answered on 18 Oct 2010, 08:13 AM
Hi John,

 I will need a sample project showing the problem you are experiencing.  By the way have you upgraded to the latest service pack? It can be downloaded from this forum thread.

Best wishes,
Atanas Korchev
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
Grid
Asked by
John
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
John
Top achievements
Rank 1
Share this question
or