From 0b981097bf953ab2e10735471ae2791beded5b7d Mon Sep 17 00:00:00 2001 From: Kerem Kayacan Date: Tue, 15 Feb 2022 09:02:12 +0300 Subject: [PATCH] Smart filterbar and table --- src/new/smart-filterbar-table.txt | 77 +++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 src/new/smart-filterbar-table.txt diff --git a/src/new/smart-filterbar-table.txt b/src/new/smart-filterbar-table.txt new file mode 100644 index 0000000..7d85368 --- /dev/null +++ b/src/new/smart-filterbar-table.txt @@ -0,0 +1,77 @@ + + + + + </semantic:titleHeading> + <semantic:content> + <Panel id="worklistPagePanel"> + <sfb:SmartFilterBar id="smartFilterBar" persistencyKey="smartFilterBarPerKey" considerSelectionVariants="true" entitySet="ZPOSAEC_LABEL" + enableBasicSearch="false" basicSearchFieldName="NodeName" showClearButton="true"> + <!-- layout data used to make the table growing but the filter bar fixed --> + <sfb:layoutData> + <FlexItemData id="SmartFilterFlexItemData" shrinkFactor="0"/> + </sfb:layoutData> + <sfb:controlConfiguration> + <sfb:ControlConfiguration key="ArticleFilter" index="1" label="{i18n>Materialnumber}" groupId="_BASIC" visibleInAdvancedArea="true"> + <sfb:customControl> + <MultiInput id="materialNumberMultiInput" showValueHelp="true" valueHelpRequest=".onMaterialValueHelpRequest"/> + </sfb:customControl> + </sfb:ControlConfiguration> + <sfb:ControlConfiguration id="ean11FilterControlConfig" key="ean11" index="2" groupId="_BASIC" visibleInAdvancedArea="true"/> + <sfb:ControlConfiguration id="changedateFilterControlConfig" key="changedate" index="3" groupId="_BASIC" visibleInAdvancedArea="true"/> + <sfb:ControlConfiguration id="changetypeFilterControlConfig" key="changetype" index="4" groupId="_BASIC" visibleInAdvancedArea="true"/> + <sfb:ControlConfiguration id="hasstockFilterControlConfig" key="has_stock" index="5" groupId="_BASIC" visibleInAdvancedArea="true"/> + </sfb:controlConfiguration> + </sfb:SmartFilterBar> + <smartTable:SmartTable id="table" entitySet="ZPOSAEC_LABEL" smartFilterId="smartFilterBar" tableType="ResponsiveTable" + useExportToExcel="true" beforeExport="onBeforeExport" useVariantManagement="true" useTablePersonalisation="true" + header="{worklistView>/worklistTableTitle}" showRowCount="true" persistencyKey="RsiSmartTable" enableAutoBinding="false" demandPopin="true" + initiallyVisibleFields="changedate,materialnumber,materialname,changetypetext,regularprice,firstcond,secondcond,thirdcond,fourthcond,fifthcond,sixthcond,seventhcond,salesamount,expiry_date" + requestAtLeastFields="retailstoreid,materialnumber" class="sapUiResponsiveContentPadding" beforeRebindTable=".onBeforeRebindTable"> + <Table growing="true" growingScrollToLoad="true"> + <columns> + <Column id="QuanColumn" hAlign="End"> + <customData> + <core:CustomData key="p13nData" + value='\{"columnKey": "QUANTITY_HIGH_OUT","columnIndex":"190", "leadingProperty": ["QUANTITY_LOW_OUT","QUANTITY_HIGH_OUT","QUANTITY_LOW_LIM","QUANTITY_HIGH_LIM","QUANTITY_LOW_ON","QUANTITY_HIGH_ON"]}'/> + </customData> + <Text text="{i18n>Quantity}"/> + </Column> + </columns> + <items> + <ColumnListItem type="Navigation" press=".onPress"> + <cells> + <VBox id="QuantityVBox"> + <HBox id="QuantityOutHBox" justifyContent="End"> + <ObjectStatus id="QuantityOutObjectStatus" state="Error" visible="{= !!${QUANTITY_HIGH_OUT} }" + text="{ path: 'QUANTITY_LOW_OUT', formatter: '.formatter.numberUnit' } - { path: 'QUANTITY_HIGH_OUT', formatter: '.formatter.numberUnit' }"/> + </HBox> + <HBox id="QuantityLimHBox" justifyContent="End"> + <ObjectStatus id="QuantityLimObjectStatus" state="Warning" visible="{= !!${QUANTITY_HIGH_LIM} }" + text="{ path: 'QUANTITY_LOW_LIM', formatter: '.formatter.numberUnit' } - { path: 'QUANTITY_HIGH_LIM', formatter: '.formatter.numberUnit' }"/> + </HBox> + <HBox id="QuantityOnHBox" justifyContent="End"> + <ObjectStatus id="QuantityOnObjectStatus" state="Success" visible="{= !!${QUANTITY_HIGH_ON} }" + text="{ path: 'QUANTITY_LOW_ON', formatter: '.formatter.numberUnit' } - { path: 'QUANTITY_HIGH_ON', formatter: '.formatter.numberUnit' }"/> + </HBox> + </VBox> + </cells> + </ColumnListItem> + </items> + </Table> + </smartTable:SmartTable> + </Panel> + </semantic:content> + </semantic:SemanticPage> +</mvc:View> + +************************************************************************************* + + onBeforeRebindTable: function (oEvent) { + var mBindingParams = oEvent.getParameter("bindingParams"); + this.getView().byId("smartFilterBar").getControlByKey("ArticleFilter").getTokens().forEach(function (oToken) { + mBindingParams.filters.push(new Filter("materialnumber", FilterOperator.EQ, oToken.getKey().padStart(18, "0"))); + }); + }, \ No newline at end of file