Как исправить smartfilterbar вверх при прокрутке - PullRequest
0 голосов
/ 05 мая 2020
• 1000 1003 *
<IconTabFilter id="ITBId" text="{i18n>Name}">
        <smartFilterBar:SmartFilterBar id="smartFilterBar" entitySet="SomeText" liveMode="true" useToolbar="true" showFilterConfiguration="true" considerSelectionVariants="true" header="{i18n>Text}">
                <smartFilterBar:controlConfiguration>
                        <smartFilterBar:ControlConfiguration key="SomeKey" index="1" visibleInAdvancedArea="true" label="SomeLabel">
                        ...
                        </smartFilterBar:ControlConfiguration>
                </smartFilterBar:controlConfiguration>
        </smartFilterBar:SmartFilterBar>
        ...
</IconTabFilter>

Спасибо

1 Ответ

0 голосов
/ 06 мая 2020

Вам нужно сделать заголовок липким.

В XML удалите липкое свойство:

<m:Table id="table" mode="MultiSelect">

В файле вашего контроллера:

onAfterRendering: function() {
    // Stick the toolbar and header of the smart table to top. 
    var oSmartTable = this.byId("__smartTableWorklist");
    oSmartTable.onAfterRendering = function() {
        var oToolbar = this.byId("stickyToolbar"),
            oParent = oToolbar.$().parent();
        if (oParent) {
            oParent.addClass("cimtStickyToolbar");
        }
    }.bind(this);
        // This is new code to make the table's header also sticky
    var oTable = this.byId("table");
    oTable.onAfterRendering = function() {
        oTable.addStyleClass("cimtStickyTableMSW");
        var oToolbar = this.byId("stickyToolbar"),
        iTop = oToolbar.$().outerHeight();
        if ($("head").find("style#cimtStickyTableMSW").length !== 0) {
            $("head").find("style#cimtStickyTableMSW").remove();
        }
        var style = $("<style id='cimtStickyTableMSW'></style>");
        $(style).html(" .cimtStickyTableMSW > table > thead > tr," +
            ".cimtStickyTableMSW > table > thead > tr > th {" +
            "   position: sticky;" +
            "   position: -webkit-sticky;" +
            "   top: " + iTop + "px;" +
            "   z-index: 100;" +
            "}");
        $("head").prepend(style); //eslint-disable-line
    }.bind(this);
}, // end of afterRendering handler of the view.

Ссылка на ссылку

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...