0
我正在使用MVC 4的jqueryuihelpers(http://jqueryuihelpers.apphb.com/Docmo/Dialog)。以下代碼來自文檔頁面。jqueryuihelpers對話框triggerclick事件源
<p>@Html.JQueryUI().Button("Click me!", new { id = "triggerButton" })</p>
@using (Html.JQueryUI().Begin(new Dialog().AutoOpen(false)
.TriggerClick("#triggerButton")))
{
<p>This dialog is opened with a button.</p>
<p>Please click the X at the top right corner to close it.</p>
}
在上面的例子中,TriggerClick的選擇器只用於一個按鈕,它工作正常。
如果我有超過1個按鈕,我想使用類選擇器「.button」。
@using (Html.JQueryUI().Begin(new Dialog().AutoOpen(false)
.TriggerClick(".button")))
{
<p>This dialog is opened with a button.</p>
<p>Please click the X at the top right corner to close it.</p>
}
在這種情況下,我如何識別哪個按鈕觸發點擊事件,然後打開對話框?