this code is written in my controller.
var textField = new sap.ui.commons.TextField({
editable: true,
liveChange:this._suggest.bind(this)
}).bindProperty("value", name);
_suggest:function(oevent){//this method is called for auto sugggest
oEvent.getSource().bindAggregation("suggestionItems", path,
new sap.ui.core.Item({
text: "{name}"
}));
}
它显示错误,因为没有找到suggestionItem。
答案 0 :(得分:1)
var oFiled = new sap.ui.commons.AutoComplete({
editable: true,
suggest: this._autoSuggest.bind(this)
}).bindValue("name");
_autoSuggest: function() {
for (var i = 0; i < aData.length; i++) {
if (jQuery.sap.startsWithIgnoreCase(aData[i].name, sValue)) {
oEvent.getSource().addItem(new sap.ui.core.ListItem({
text: aData[i].name
}));
}
}
}