I use the following control and I wonder if there is a way that if user for example type aaa and this is
part of the auto complete put this aaa in bold
e.g.
user have this option
aaa/bb/ccc
and the user type aaa so he get aaa/bb/ccc
if he type cc you get aaa/bb/ccc
is it possible?
AutoComplete - SAPUI5 Demo Kit
Title Typo edited by: Michael Appleby
Hi Stephane,
First know the id of the listBox of autocomplete by doing inspect element(right click on the listbox of the autocomplete and click inspect element). And then try with the following code: that is by using liveChange event
createContent : function(oController) { //Initialize a JSON Model var oModel2 = new sap.ui.model.json.JSONModel(); oModel2.setData(aData); //Create a AutoComplete control and bind the items aggregation var oAuto2 = new sap.ui.commons.AutoComplete("auto1",{ tooltip: "Enter a name", maxPopupItems: 5, displaySecondaryValues: true, items: { path: "/", template: new sap.ui.core.ListItem({text: "{name}", additionalText: "{userid}"}) }, liveChange: function() { document.getElementById("auto1-lb-list").style.fontWeight = "bold"; }); oAuto2.setModel(oModel2); //attach it to some element in the page oAuto2.placeAt("content"); } });
Hope this helps😊
Regards,
Lahari
you would need to extend sap.ui.commons.ListBox
no such functionality out of the box
Add a comment