Telerik DropDownList で HtmlAttributes 値をクエリするにはどうすればよいですか? jQueryでこれを行う方法は知っていますが、これらを照会する適切な方法は何ですか?
@(Html.Telerik().DropDownListFor(model => model.BookingOfficeIdNew)
.Name("BookingOfficeIdNew")
.HtmlAttributes(new
{
// How do I access these?
@class = "PropertyProposedValueSelect",
@delta = Model.BookingOfficeIdNew,
@container = "BookingOfficeContainer",
@updateFlag = "BookingOfficeIdChanged",
@deltaValue = "BookingOfficeIdOld",
@newValue = "BookingOfficeIdNew",
@newText = "BookingOfficeNameNew"
})
.ClientEvents(events => events
.OnChange("SelectListValueUpdated")
.OnLoad("OnDropDownListLoad")
.OnOpen("OnDropDownListOpen")
)
.BindTo(Model.BookingOfficeIdChanged ? @Html.ToSelectList(Model.BookingOfficeNameNew, Model.BookingOfficeIdNew, true) : ((SelectListItem)ViewData["DefaultSelectListPrompt"]).ToSelectList(true))
.SelectedIndex(0)
.DataBinding(binding => binding.Ajax().Select("RraOfficeSelectListWithPrompt", "Revision"))
)
編集/回答:適切なクラス名を使用して、親コンテナーを選択することを選択しました。Telerik DropDownList 拡張機能は、id = "BookingOfficeIdNew" の入力要素を生成し、その親 div コンテナーには ".t-dropdown" クラスがあります。
$("#BookingOfficeIdNew").parent(".t-ドロップダウン")