<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Multi input Column filtering in Sap.ui.table is not working in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/multi-input-column-filtering-in-sap-ui-table-is-not-working/qaa-p/12372296#M4631603</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Have you tried to bind the model to the table, and set only the Filter Property to the columns, whithout the table event &lt;STRONG&gt;filterCols&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;The table itself should take care about the default filter function.&lt;/P&gt;&lt;P&gt;Please check following example:&lt;/P&gt;&lt;P&gt;&lt;A href="https://sapui5.hana.ondemand.com/#/entity/sap.ui.table.Table/sample/sap.ui.table.sample.OData" target="test_blank"&gt;https://sapui5.hana.ondemand.com/#/entity/sap.ui.table.Table/sample/sap.ui.table.sample.OData&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Oct 2021 06:51:08 GMT</pubDate>
    <dc:creator>ThorstenHoefer</dc:creator>
    <dc:date>2021-10-13T06:51:08Z</dc:date>
    <item>
      <title>Multi input Column filtering in Sap.ui.table is not working</title>
      <link>https://community.sap.com/t5/technology-q-a/multi-input-column-filtering-in-sap-ui-table-is-not-working/qaq-p/12372295</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
  &lt;P&gt;I am trying to implement&lt;STRONG&gt; sap.ui.table.column&lt;/STRONG&gt; multi input Filtering in &lt;STRONG&gt;sap.ui.table&lt;/STRONG&gt; . I am able to successfully create filters but it's not working. Please check below code which I implemented to create filters for multiple columns.&lt;/P&gt;
  &lt;P&gt;I have applied two input in first column separated by comma&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1878791-ecvtg.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Again applied two input in fourth column. &lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1878789-mqtyt.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;Xml view &lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&amp;lt;Table id="idParentTable" rows="{DetailData&amp;gt;/ProductCollection}" selectionMode="MultiToggle" visibleRowCount="10" visibleRowCountMode="Fixed" enableCellFilter="true" &lt;STRONG&gt;filter="filterCols"&lt;/STRONG&gt; enableSelectAll="true" alternateRowColors="true"&amp;gt;&lt;/P&gt;
  &lt;P&gt;&amp;lt;columns&amp;gt; &lt;/P&gt;
  &lt;P&gt;&amp;lt;Column id="idWBS1ID" &lt;STRONG&gt;filterProperty="Name"&lt;/STRONG&gt; width="10rem" filterType="sap.ui.model.type.String"&amp;gt; &amp;lt;m:Label text="{i18n&amp;gt;WBS1ID}"/&amp;gt; &amp;lt;template&amp;gt; &amp;lt;m:Text text="{DetailData&amp;gt;Name}" wrapping="false"/&amp;gt; &amp;lt;/template&amp;gt; &amp;lt;/Column&amp;gt;&lt;/P&gt;
  &lt;P&gt;&amp;lt;Column width="10rem" &lt;STRONG&gt;filterProperty="Quantity"&lt;/STRONG&gt; filterType="sap.ui.model.type.Integer"&amp;gt; &amp;lt;m:Label text="{i18n&amp;gt;WBS4_1_Element_ID}"/&amp;gt; &amp;lt;template&amp;gt; &amp;lt;m:Text text="{DetailData&amp;gt;Quantity}" wrapping="false"/&amp;gt; &amp;lt;/template&amp;gt; &amp;lt;/Column&amp;gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;Controller&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;filterCols: function(oEvent)&lt;/STRONG&gt; { &lt;/P&gt;
  &lt;P&gt;var that = this; oEvent.getParameter("column").setFiltered(true); &lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;this.filterFormation(); &lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;},&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;filterFormation: function() { &lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;var that = this; &lt;/P&gt;
  &lt;P&gt;that._oLFilter; &lt;/P&gt;
  &lt;P&gt;this.filteredColumn = []; &lt;/P&gt;
  &lt;P&gt;var oColumns = this.byId("idParentTable").getColumns(); &lt;/P&gt;
  &lt;P&gt;oColumns.forEach(function(column) {&lt;/P&gt;
  &lt;P&gt; if (column.getFiltered()) { &lt;/P&gt;
  &lt;P&gt;var filterValue = column.getAggregation("menu").getAggregation("items")[0].getProperty("value"); &lt;/P&gt;
  &lt;P&gt;filterValue.split(",").forEach(function(value) { &lt;/P&gt;
  &lt;P&gt;that.filteredColumn.push(new sap.ui.model.Filter(column.getProperty("filterProperty"), sap.ui.model.FilterOperator.Contains, value)); }) } }); &lt;/P&gt;
  &lt;P&gt;this.aColArray = [];&lt;/P&gt;
  &lt;P&gt; this.previous = null; &lt;/P&gt;
  &lt;P&gt;this.aMainFilter = []; &lt;/P&gt;
  &lt;P&gt;this.bFlag = true; &lt;/P&gt;
  &lt;P&gt;that.filteredColumn.forEach(function(value) { &lt;/P&gt;
  &lt;P&gt;if (value.sPath === that.previous || that.previous === null) { &lt;/P&gt;
  &lt;P&gt;that.previous = value.sPath;&lt;/P&gt;
  &lt;P&gt; that.aColArray.push(value);&lt;/P&gt;
  &lt;P&gt; } else { &lt;/P&gt;
  &lt;P&gt;that.bFlag = false; &lt;/P&gt;
  &lt;P&gt;var aOrFilter =&lt;STRONG&gt; that.globalFilterFormation(that.aColArray); &lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;that.aMainFilter.push(aOrFilter);&lt;/P&gt;
  &lt;P&gt; that.aColArray = []; &lt;/P&gt;
  &lt;P&gt;that.aColArray.push(value);&lt;/P&gt;
  &lt;P&gt; that.previous = value.sPath; } &lt;/P&gt;
  &lt;P&gt;})&lt;/P&gt;
  &lt;P&gt; if (this.bFlag = true) { &lt;/P&gt;
  &lt;P&gt;var aOrFilter =&lt;STRONG&gt; this.globalFilterFormation(this.aColArray); &lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;that.aMainFilter.push(aOrFilter);&lt;/P&gt;
  &lt;P&gt; } &lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;var goFil = new Filter(that.aMainFilter, true); &lt;/STRONG&gt;//goFil Value is highlighted in below screenshot&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;this.byId("idParentTable").getBinding("rows").filter(goFil, "Application"); &lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;},&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;globalFilterFormation: function(aFilter) { &lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;var oLFilter = new sap.ui.model.Filter(&lt;/P&gt;
  &lt;P&gt;{ filters: aFilter, and: false }&lt;/P&gt;
  &lt;P&gt;);&lt;/P&gt;
  &lt;P&gt; return oLFilter; &lt;/P&gt;
  &lt;P&gt;},&lt;/P&gt;
  &lt;P&gt;&lt;IMG alt="" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2021 14:46:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/multi-input-column-filtering-in-sap-ui-table-is-not-working/qaq-p/12372295</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2021-01-23T14:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Multi input Column filtering in Sap.ui.table is not working</title>
      <link>https://community.sap.com/t5/technology-q-a/multi-input-column-filtering-in-sap-ui-table-is-not-working/qaa-p/12372296#M4631603</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Have you tried to bind the model to the table, and set only the Filter Property to the columns, whithout the table event &lt;STRONG&gt;filterCols&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;The table itself should take care about the default filter function.&lt;/P&gt;&lt;P&gt;Please check following example:&lt;/P&gt;&lt;P&gt;&lt;A href="https://sapui5.hana.ondemand.com/#/entity/sap.ui.table.Table/sample/sap.ui.table.sample.OData" target="test_blank"&gt;https://sapui5.hana.ondemand.com/#/entity/sap.ui.table.Table/sample/sap.ui.table.sample.OData&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Oct 2021 06:51:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/multi-input-column-filtering-in-sap-ui-table-is-not-working/qaa-p/12372296#M4631603</guid>
      <dc:creator>ThorstenHoefer</dc:creator>
      <dc:date>2021-10-13T06:51:08Z</dc:date>
    </item>
  </channel>
</rss>

