This question is locked. New answers and comments are not allowed.
Hi,
I am trying to mouseover or hover over a name from one column, and, I need the ID (key) of that row which is in another column.
I have a grid that looks like this ....
Using mouseover , I can access the name with its class ".cName" from any row, but even with the class ".cId" of the key field cCompanyNo, this key keeps comming back as the key of the very first row only. I cannot use the "this" keyword on the key because "this" is for the element (column) moused over ?
I have tried several variations but I cannot seem to get the key of the moused over row ?
thanks as always for your time
I am trying to mouseover or hover over a name from one column, and, I need the ID (key) of that row which is in another column.
I have a grid that looks like this ....
| <%= Html.Telerik().Grid(Model) |
| .Name("CompanyGrid") |
| .Columns(columns => |
| { |
| columns.Add(o => o.cCompanyName).Width(185).Title((string)Resources.BCAResources.coxCompany) |
| .HtmlAttributes(new { @class = "ihover cName"}); |
| columns.Add(o => o.cPhone).Title((string)Resources.BCAResources.stdPhone).Width(75); |
| columns.Add(o => o.cGroupCode).Title((string)Resources.BCAResources.coxGroupCode).Width(100); |
| columns.Add(o => o.cEmail).Format(Html.Mailto("{0}", "{0}")).Encoded(false).Width(150); |
| columns.Add(o => o.cDateUpdated).Format("{0:MM/dd/yyyy}").Width(85) |
| .Title((string)Resources.BCAResources.stdUpdated); |
| columns.Add(o => o.cCompanyNo).Format(Html.ActionLink((String)Resources.BCAResources.stdEdit, "Index", "Work", new { workindex = 2, OtherParms = "{0}" }, null).ToString()).Encoded(false).Title("").Width(32).Filterable(false); |
| columns.Add(o => o.cCompanyNo).Format(Html.ActionLink((String)Resources.BCAResources.stdDelete, "CompanyDelete", new { Id = "{0}" }, null).ToString()).Encoded(false).Title("").Width(50).Filterable(false); |
| columns.Add(o => o.cCompanyNo).Width(0) |
| .HeaderHtmlAttributes(new { style = "display:none" }) |
| .HtmlAttributes(new { @class = "cId", style = "display:none" }); |
| }) |
| .DataBinding(dataBinding => dataBinding.Ajax().Select("_AjaxBindingCompany", "Company")) |
| .Pageable() |
| .Sortable(sort => sort.SortMode(GridSortMode.MultipleColumn)) |
| .Scrollable(scrolling => scrolling.Height(253)) |
| .Filterable() |
| %> |
Using mouseover , I can access the name with its class ".cName" from any row, but even with the class ".cId" of the key field cCompanyNo, this key keeps comming back as the key of the very first row only. I cannot use the "this" keyword on the key because "this" is for the element (column) moused over ?
| $(".cName").mouseover(function() { |
| alert("the name " + $(this).html()); |
| alert("and the key is :" + $(".cId").html()); |
| }); |
I have tried several variations but I cannot seem to get the key of the moused over row ?
thanks as always for your time