How can I reference the clicked Ajax.ActionLink
from within it's OnBegin
function?
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', '');
}