我想實現移動面板裏面正好旁邊命令按鈕點擊一個HTML表中的行,像這樣不同的元素另一TR下:將現有元素到一個新的TR使用JQuery
jQuery("[id*=lnkButton]").click(function() {
$(this).closest('tr').after("<tr class ='alt'><td> appendTo here </td></tr>");
//$("#source").appendTo("#destination"); how to run this line inside TD and make the panel visible in there upon inserted
}
這就是我想要移動到新創建的行面板:
<asp:Panel ID='panelPhotos' runat='server' Visible="False"> a lot of elements</Panel>
面板包含如下鏈接:點擊事件按鈕服務器控件...
氏s是表(GridView控件):
<asp:GridView ID="gridScopeItem" runat="server" AllowPaging="True" DataKeyNames="ItemID" AutoGenerateColumns="False" OnPageIndexChanging="gridScopeItem_PageIndexChanging" OnRowCommand="gridScopeItem_RowCommand" OnSelectedIndexChanged="gridScopeItem_SelectedIndexChanged"
PageSize="10" Caption="Scope Items" ClientIDMode="Static">
<Columns>
<asp:BoundField DataField="ItemID" HeaderText="Item ID"/>
<asp:BoundField DataField="Cat" HeaderText="CAT" ReadOnly="true"/>
<asp:BoundField DataField="Sel" HeaderText="SEL" ReadOnly="true"/>
<asp:BoundField DataField="Activity" HeaderText="ACT" ReadOnly="true"/>
<asp:BoundField DataField="SpecDetailedDescription" ReadOnly="true" HeaderText="Description" />
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton runat="server" ID="Link1" CommandName="detail" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" Text="<img src='img/upload.png' title= 'Upload Pictures' style='max-height: 20px; max-width: 30px;' />" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
所以,當我點擊該LinkButton的我需要添加新的TR/TD與現有面板(panelPhotos)內。
你可能想發佈一些HTML而不是ASP.NET。 – MortenMoulder