<%foreach (var indication in Model.FindAll(m => m.Model != null && m.Model.Trx != null).OrderBy(m => m.Model.Trx.PrimarySponsor.Company))
{ %>
<tr>
<td><%= indication.DisplayUser %></td>
<td><%= indication.ActiveIndicationUsers[0].FullName %></td>
<td><%= string.IsNullOrEmpty(indication.Model.Trx.PrimarySponsor.Company) ? "Not Yet Saved" : indication.Model.Trx.PrimarySponsor.Company %></td>
<td><%= indication.TimeOpened.ToString(Chatham.Web.Data.Constants.Format.DateTimeSecondsFormatString) %></td>
<td><%= indication.Model.Trx.ProductCollection[0].ProductTypeFriendlyName %></td>
<td><%= (!indication.Model.Trx.ID.HasValue) ? "Not Yet Saved" : indication.Model.Trx.ID.Value.ToString() %></td>
<td><input type="button" value="Open" name="<%= (!indication.Model.Trx.ID.HasValue) ? "Not Yet Saved" : indication.Model.Trx.ID.Value.ToString() %>" /></td>
</tr>
<%} %>
위에서 볼 수 있듯이 동적으로 생성됩니다. 버튼 클릭을 어떻게 처리합니까? 단추의 클릭을 처리하는 모든 메서드에 단추의 name
특성을 전달하려고합니다.동적으로 생성 된 테이블의 처리 버튼 클릭
감사합니다.
니스! 고맙습니다! – slandau
또한, .delegate는 1.4.2 이후의 jquery와 바인딩하는 방법이 멋지고 타겟이 명확합니다. http://brandonaaron.net/blog/2010/03/4/event-delegation-with-jquery –
@Zach : 링크 Thx. – Chandu