在网格视图中单击编辑时,在Jquery中显示/隐藏折叠面板?

时间:2022-12-01 13:38:43

I have a Jquery Accordion and I have a asp.net GridView below that. When I click on the edit button in a gridview row, it goes and grabs some data. Depending on which row is clicked, I want to show/hide an accordion panel. Can I accomplish this in the GridView_RowEditing event, if so, how?

我有一个Jquery手风琴,下面有一个asp.net GridView。当我点击gridview行中的编辑按钮时,它会抓取一些数据。根据单击的行,我想显示/隐藏手风琴面板。我可以在GridView_RowEditing事件中完成此操作,如果是这样,怎么做?

1 个解决方案

#1


ClientScript.RegisterStartupScript
(Me.GetType(), "ClientScript", "$(document).ready(function(){$('#accordion').accordion('activate', parseInt(theIndex));}", True)

So, I haven't tried this, but it seems like it should work. But you might have to play with it a little, theIndex will need to variable passed in from the grid row.

所以,我没有试过这个,但它似乎应该工作。但是你可能需要稍微玩一下,theIndex将需要从网格行传入的变量。

#1


ClientScript.RegisterStartupScript
(Me.GetType(), "ClientScript", "$(document).ready(function(){$('#accordion').accordion('activate', parseInt(theIndex));}", True)

So, I haven't tried this, but it seems like it should work. But you might have to play with it a little, theIndex will need to variable passed in from the grid row.

所以,我没有试过这个,但它似乎应该工作。但是你可能需要稍微玩一下,theIndex将需要从网格行传入的变量。