<?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: Smart Table - Smart Filter: setFilterData &amp; Searchfield in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/smart-table-smart-filter-setfilterdata-searchfield/qaa-p/12267097#M4595013</link>
    <description>&lt;P&gt;You have to use rebind event handler and have to handle the filters there, check the below answer&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/50390460/sapui5-auto-bind-smart-table-with-filters" target="test_blank"&gt;https://stackoverflow.com/questions/50390460/sapui5-auto-bind-smart-table-with-filters&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Aug 2020 10:29:50 GMT</pubDate>
    <dc:creator>maheshpalavalli</dc:creator>
    <dc:date>2020-08-10T10:29:50Z</dc:date>
    <item>
      <title>Smart Table - Smart Filter: setFilterData &amp; Searchfield</title>
      <link>https://community.sap.com/t5/technology-q-a/smart-table-smart-filter-setfilterdata-searchfield/qaq-p/12267096</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
  &lt;P&gt;I want the smartTable filters to be set at startup. I want to set this in the controller because I get certain IDs that I want to set as filters.&lt;BR /&gt;Also, the filter bar (next to the start button) is grayed out and I don't know why.&lt;BR /&gt;&lt;BR /&gt;I know that you can set the filter somehow with setFilterData but I can't get it to work and I can't find a complete example for this.&lt;BR /&gt;I tried this:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;                var oTableData = this.getView().byId("sTable").getBinding("items");

                var sortedData = oTableData.sSortParams;

                var filtersData = oTableData.sFilterParams;

                var list = this.getView().byId("sTable");
                var binding = list.getBinding("items");
                var query = oEvent.getParameter("query");
                if (!query) {
                    binding.filter([]);
                } else {
                    binding.filter([new sap.ui.model.Filter([
                        new sap.ui.model.Filter("name", sap.ui.model.FilterOperator.Contains, query),
                        new sap.ui.model.Filter("gender", sap.ui.model.FilterOperator.Contains, query)
                    ], false)]);
                }&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt; but it doesn't work, the problem starts already that it doesn't find bindings with "items".&lt;/P&gt;
  &lt;P&gt;Maybe someone has a good example for me with View and Controller?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 09:46:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/smart-table-smart-filter-setfilterdata-searchfield/qaq-p/12267096</guid>
      <dc:creator>truckla</dc:creator>
      <dc:date>2020-08-10T09:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Smart Table - Smart Filter: setFilterData &amp; Searchfield</title>
      <link>https://community.sap.com/t5/technology-q-a/smart-table-smart-filter-setfilterdata-searchfield/qaa-p/12267097#M4595013</link>
      <description>&lt;P&gt;You have to use rebind event handler and have to handle the filters there, check the below answer&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/50390460/sapui5-auto-bind-smart-table-with-filters" target="test_blank"&gt;https://stackoverflow.com/questions/50390460/sapui5-auto-bind-smart-table-with-filters&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 10:29:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/smart-table-smart-filter-setfilterdata-searchfield/qaa-p/12267097#M4595013</guid>
      <dc:creator>maheshpalavalli</dc:creator>
      <dc:date>2020-08-10T10:29:50Z</dc:date>
    </item>
  </channel>
</rss>

