Javascript Primefaces datatable每页行模板下拉列表焦点应位于顶部分页
我有一个带有paginatorPosition=“both”和rowsPerPageTemplate=“15,25,50,75”的p:datatable。加载时,焦点应位于顶部下拉列表中。但重点是底部下拉列表Javascript Primefaces datatable每页行模板下拉列表焦点应位于顶部分页,javascript,primefaces,Javascript,Primefaces,我有一个带有paginatorPosition=“both”和rowsPerPageTemplate=“15,25,50,75”的p:datatable。加载时,焦点应位于顶部下拉列表中。但重点是底部下拉列表 <p:dataTable id="resultsTable_#{cc.attrs.lovId}" var="lov" paginator="true" rows="15" value="#{cc.attrs.dataModel}" rowsPerPageTemplate="15, 2
<p:dataTable id="resultsTable_#{cc.attrs.lovId}" var="lov" paginator="true" rows="15" value="#{cc.attrs.dataModel}" rowsPerPageTemplate="15, 25, 50, 75"
rowKey="#{cc.attrs.rowKey}" selectionMode="single" pageLinks="5" paginatorPosition="both" rowIndexVar="rowIndexVar"
paginatorTemplate="Page {CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
paginatorAlwaysVisible="true" styleClass="LOVTable"
selection="#{lovPreferences.selectedObj}"
widgetVar="lovTable_#{cc.attrs.lovId}"
filteredValue = "#{lovPreferences.filteredResults}"
emptyMessage="Data is loading please wait..."
lazy = "#{cc.attrs.lazyLoadIndicator}"
filterDelay="1000"
>
使用以下功能:
...
<h:body onload='ExecuteFunction()' >
<script>
function ExecuteFunction() {
jQuery(window).on("load", function() {
jQuery("yourFormID:yourDatatableID:yourPaginatorID)".addClass('ui-state-hover ui-state-focus'));
});
}
</script>
...
。。。
函数ExecuteFunction(){
jQuery(窗口).on(“加载”,函数(){
jQuery(“yourFormID:yourDatatableID:yourPaginatorID)”.addClass('ui-state-hover-ui-state-focus');
});
}
...
关于,对不起,我很好奇你为什么需要这个?当焦点位于底部时,下拉选项不完全可见。@santosh,如果我的答案解决了你的问题,别忘了确定?