如何在javascript中选择没有id的行(使用网格) [英] how to select a row without an id in javascript (using grid)

查看:71
本文介绍了如何在javascript中选择没有id的行(使用网格)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要紧急帮助!!



i想要点击(kendo-telerik)网格中的一行并将其导航到另一页,其中进一步描述了行的详细信息。请帮忙。



谢谢。

解决方案

你可以这样试试



Javascript



  //  导航到id的详细信息页面 
var functionNavigate = < span class =code-keyword> function (id){

var url = ' @ Url.Action(ActionName,ControllerName)?id =' + id;
window location .href = url;
}





Kendo Grid



 @(Html.Kendo()。Grid< EntityName> 
()
.Name( grid
.Columns(columns = >
{


columns.Bound(c = > c.ID)。标题( ID)。宽度( 90 )。ClientTemplate( < button type ='button'onclick ='functionNavigate(\#:ID#\)'>#:ID#< ; / button>);
columns.Bound(c = > c.Column2)。标题( 标题2)。宽度( 85 );


NEED URGENT HELP !!

i want to click a row in a (kendo-telerik) grid and navigate it a another page where the row's details are further described. pls help.

thanks.

解决方案

You can try like this

Javascript

// navigates to the details page of  id
 var functionNavigate = function (id) {

     var url = '@Url.Action("ActionName", "ControllerName")?id=' + id;
     window.location.href = url;
 }



Kendo Grid

@(Html.Kendo().Grid<EntityName>
    ()
    .Name("grid")
    .Columns(columns =>
    {


    columns.Bound(c => c.ID).Title("ID").Width(90).ClientTemplate("<button type='button' onclick='functionNavigate(\"#: ID #\")' >#: ID #</button>");
    columns.Bound(c => c.Column2).Title("Title 2").Width(85);


这篇关于如何在javascript中选择没有id的行(使用网格)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆