带下钻的Gridview [英] Gridview with drill down
问题描述
您好,我遇到了一个问题,我迷失了很长时间,但我无法解决.我有两个gridview,每个记录(行)都有一个"+",当单击该行时,它将更改为-",并在单击"+"的行下方添加一行,单击-"时,该行消失.下面显示的行是单击的行上其信息的详细信息.我在jquery中有代码,但是当我单击-"时,任何行都会最小化gridview的任何行,因此当我单击图像时,带有符号之一的列不会更改,在这种情况下,您可以添加该行在下面.
这是我的jquery代码:
hello people, I have an issue where I have lost a long time but I can not solve. I have two gridviews and each record (row) has a "+" which when clicked will change to "-" and adds a row below the line where you clicked the "+" and when clicked the "-" that line disappears. The line that appears below is the details of their information that is on the line that was clicked. I have code in jquery but when I click the "-" any line minimizes any row of gridview, so when I have a column with one of the symbols does not change when I click the image and in this case you can just add the line below.
Here is my jquery code:
<script type="text/jscript">
$('.View').click(function()
{
$('#details').remove();
var detailID=$(this).attr('data-id');
$(this).closest('tr').after('<tr id="details"><td colspan="9"></td></tr>')
$('#details td').load('Details.aspx?detail='+detailID+' #content');
});
</script>
<script type="text/jscript">
$('.Hide').click(function()
{
$('table td img.Hide').click(function(){ $(this).parent().parent().remove(); });
});
</script>
推荐答案
(' 函数() {
('.View').click(function() {
(' #details').remove() ; var detailID =
('#details').remove(); var detailID=
( this ).attr(' 数据ID');
(this).attr('data-id');
这篇关于带下钻的Gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!