如何Ajax.ActionLink
从其OnBegin
功能中引用单击?
cshtml
@Ajax.ActionLink(
typeName,
"OrderQueueRows",
new
{
typeNames = Model.Name,
includeDerivedTypes = ViewBag.IncludeDerivedTypes,
excludeCompletedOrders = ViewBag.ExcludeCompletedOrders
},
new AjaxOptions {
LoadingElementId="ajax-loading",
OnBegin = "highlightFilter",
UpdateTargetId = "order-queue-body"
},
new { @class = "show-exclusively" })
javascript
function highlightFilter() {
$link = $(this);
$link.css('color', 'red');
$link.siblings().not($link).css('color', '');
}