我有这段代码在浏览器中运行良好,但是当我尝试在移动浏览器上运行时,它不起作用。有什么好的建议吗?
var oTextArea = this.getView().byId("selectConditionAS");
oTextArea.attachBrowserEvent("keyup", debounce(function() {
var searchkey = oTextArea.getValue();
console.log(searchkey);
}
如果您有执行相同操作的 SAPUI5 事件,则不需要使用浏览器事件。如果您使用sap.m.TextArea或sap.ui.commons.TextField那么您可以使用他们的liveChange事件。
var oTextArea = this.getView().byId("selectConditionAS");
oTextArea.attachLiveChange(function(oEvent){
var searchkey = oEvent.getSource().getValue();
console.log(searchkey)
});
希望这可以帮助。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句