每个页面的Primefaces数据表行模板下拉重点应放在顶部

时间:2018-07-04 05:14:17

标签: javascript primefaces

我有一个p:datatable,带有paginatorPosition =“ both”和rowsPerPageTemplate =“ 15、25、50、75”。加载时,焦点应放在顶部下拉菜单上。但是重点放在底部下拉列表上。

<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"
                >

https://imgur.com/a/1d8HCM8

1 个答案:

答案 0 :(得分:0)

使用功能:

...
<h:body onload='ExecuteFunction()' >
    <script>
    function ExecuteFunction() {
        jQuery(window).on("load", function() {
            jQuery("yourFormID:yourDatatableID:yourPaginatorID)".addClass('ui-state-hover ui-state-focus'));
        });
    }
    </script>
...

此致