cancel
Showing results for 
Search instead for 
Did you mean: 

How to return data from filterBar to table .??

virendra_soni2
Participant
0 Kudos

Hi all

I facing problem in my Code

Actually i want make filter bar and table ..

when i select some data of filter elements in filterbar then after pressing  GO button the data should be display in table.

pls share any mock up Code for that.

Regards,

Virendra Soni

Accepted Solutions (1)

Accepted Solutions (1)

vijay_kumar49
Active Contributor
0 Kudos

Please check this code. it should be useful. Filter Example-1 and  Filter Example-2


Kindly let me know if you need any more information.

virendra_soni2
Participant
0 Kudos

Hi vijay

actually I have one filter elements in  filterBar

the filter elements consists one CoboBOx ..

<ComboBox>
<core:Item key="ProductId" text="Name" />

<core:Item key="ProductId" text="Name1" />

<core:Item key="ProductId" text="Name2" />
</ComboBox>

suppose i select Name1

then after pressing GO button

Name1 should be printer in Table.

Regards,

Virendra

vijay_kumar49
Active Contributor
0 Kudos

when you click on "GO" Button. read the data from the Combo Box and set to corresponding table. then the table is executed and display the filtered data in UI5 table.

<Button  text="Filter" press="onSearch" icon="sap-icon://filter"/>

its called onSearch in control

onSearch: function(oEvent) {
 
var comboBoxValue = this.byId("oComboBox").getValue(), //oComboBox id of combo box
oBinding
= this._oTable.getBinding("items"),
oFilter
;
 
if (comboBoxValue || comboBoxValue === "") {
 
this._oTable.setShowOverlay(false);
oFilter
= new Filter("SupplierName", "EQ", comboBoxValue);
oBinding
.filter([oFilter]);
 
}
 
}
});

Answers (0)