複数選択 jquery ウィジェットのフィルター テキスト入力フィールドにフォーカスを設定する小さなスクリプトを作成しています。ドキュメントに基づいて、次のようにウィジェットのクリック イベントをサブスクライブできます。
// bind to event
$("#multiselect").bind("multiselectopen", function(event, ui){
// event handler here
});
だから私はこれを試しました:
$("#MyStatusWidget").bind("multiselectopen", function(event, ui){
// event handler here
$(this).$(".ui-multiselect-filter").contents('input :text').focus());
});
ウィジェットへのリンクは次のとおりです: http://www.erichynds.com/jquery/jquery-ui-multiselect-widget/
他のいくつかの方法 ($('').is(':text'); など) も試しましたが、フックを取得できません。
HTMLは次のとおりです。
<div class="ui-widget-header ui-corner-all ui-multiselect-header ui-helper-clearfix ui-multiselect-hasfilter">
<div class="ui-multiselect-filter">
Filter:
<input type="search" placeholder="Enter keywords">
</div>
<ul class="ui-helper-reset">
</div>
ありがとうございました