选择剑道网格选定的行 [英] Select kendo grid selected row

查看:213
本文介绍了选择剑道网格选定的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在Kendo Pivot网格上工作,其中URL显示为行,而Months显示为列.请参阅附件.

月列的值具有锚标记,URL的行值也具有锚标记.

URLs行还具有子部分(Webparts),当我扩展Webparts时,它具有更多的值,例如自动表单,列表查看器等....都在同一URL下.
这些Webpart具有由
自动应用的CSS类展开和折叠 Kendo API.

我的要求是:当我单击月份"列值时,我能够获得URL值,但是当我展开URL并单击月份"单元格值时,则我无法获得相同的URL,而是给了我下一行URL值. br/>
假设一个URL(www.yahoo.com)具有子部分(Webparts)作为自动表单",列表查看器",当我单击自动表单月份"单元格值时,它将给我下一个URL值,而应该给我www. yahoo.com.同样,当我单击列表查看器"时,我也应该给我www.yahoo.com.

JS代码如下:-


函数ShowUserSkills(value)
{
试试
{
var row = $(value).closest("tr");

var rowIdx = $("tr",value.parentElement.parentElement.parentElement.parentElement).index(row);
var colIdx = $("td",row).index($(value).closest("td"))+ 1;

var Month =($(#pivotgrid_url_webparts>表&t; tbody> tr> td:nth-​​child(2)> div> div.k-grid.k-widget> div.k-grid-标头> div>表> tbody> tr:nth-​​child(2)&th; th:nth-​​child("+ colIdx +")> span)[0] .innerHTML);

$(''.k-icon,.k-i-expand'').click(function()
{
尝试{
var row1 = $(this).closest("tr")
alert(''ok'');
var rowIdx1 = $("tr").index(row1);
alert(''rowIdx1:''+ rowIdx1);
}抓住(e){
警报(e.message);
}


//if($(this).hasClass("k-icon k-i-expand"))
//{
//alert(''found'');
//}
//else
//{
//alert(''未找到'');
//}
});

var URL =($(#pivotgrid_url_webparts>表&t; tbody> tr> td:nth-​​child(1)> div> div.k-grid.k-widget.k-alt"). ("tbody").find("a")[rowIdx] .innerHTML);

Open_Popup_Window("user_statistics_url.html?eventtime =''" +月+''& appurl =""+ URL +"'',70,300);
}
抓住(e)
{
警报(e.message);
}
}

< a id ="url" href =''javascript:ShowUserSkills(this);" onclick ="ShowUserSkills(this);返回false;" style ="font-style:normal; cursor:pointer;">#:dataItem.value#</a>

请帮我解决这个问题.

谢谢!!!!!!!!!!!!

< b>我尝试过的事情:</b>

我尝试使用上述JavaScript代码.

Hello Guys,

I am working on Kendo Pivot grid where URLs are showing as a Row and Months are showing as Column. please see attachment.

Months column values have anchor tag and also URLs row values are having anchor tags.

URLs row have also sub-parts (Webparts) and when i expand webparts then it has some more values like autoform, list viewer and so on.... which are under same URL.
These webparts are having css class expand and collapse applied automatically by
Kendo api.

My requirement is : When i click on Month column value then i am able to get the URL value but when i expand URL and click on Month cell value then i am not able to get same url instead it gives me next row URL value.

Suppose one URL(www.yahoo.com) is having sub-part (Webparts) as Autoform, List Viewer and when i click on Autoform month cell value value then it''s giving me next URL value instead it should give me www.yahoo.com. Similarly when i click on List Viewer, then alsom i should give me www.yahoo.com.

JS code is below:-


function ShowUserSkills(value)
{
try
{
var row = $(value).closest("tr");

var rowIdx = $("tr", value.parentElement.parentElement.parentElement.parentElement).index(row);
var colIdx = $("td", row).index($(value).closest("td")) + 1;

var Month = ($("#pivotgrid_url_webparts > table > tbody > tr > td:nth-child(2) > div > div.k-grid.k-widget > div.k-grid-header > div > table > tbody > tr:nth-child(2) > th:nth-child(" + colIdx + ") > span")[0].innerHTML);

$(''.k-icon, .k-i-expand'').click(function ()
{
try {
var row1 = $(this).closest("tr")
alert(''ok'');
var rowIdx1 = $("tr").index(row1);
alert(''rowIdx1 : '' + rowIdx1);
} catch (e) {
alert(e.message);
}


//if ($(this).hasClass("k-icon k-i-expand"))
//{
// alert(''found'');
//}
//else
//{
// alert(''not found'');
//}
});

var URL = ($("#pivotgrid_url_webparts > table > tbody > tr > td:nth-child(1) > div > div.k-grid.k-widget.k-alt").find("tbody").find("a")[rowIdx].innerHTML);

Open_Popup_Window("user_statistics_url.html?eventtime=''" + Month + "''&appurl=''" + URL + "''", 70, 300);
}
catch (e)
{
alert(e.message);
}
}

<a id="url" href=''javascript:ShowUserSkills(this);'' onclick="ShowUserSkills(this); return false;" style="font-style: normal; cursor:pointer;">#:dataItem.value #</a>

Please help me out on this.

Thanks !!!!!!!!!!!!

<b>What I have tried:</b>

I tried with javascript code stated above.

推荐答案

(value).closest("tr");

var rowIdx =
(value).closest("tr");

var rowIdx =


("tr",value.parentElement.parentElement.parentElement.parentElement).index(row);
var colIdx =
("tr", value.parentElement.parentElement.parentElement.parentElement).index(row);
var colIdx =


("td",行).index(
("td", row).index(


这篇关于选择剑道网格选定的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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