【发布时间】:2017-01-16 15:50:09
【问题描述】:
尝试提交一个自动完成搜索框,其中包含输入框中的文本。我可以使用onValueChanged,但它会触发每个按键。按下回车时我需要搜索。我已经尝试了几件事,但无法解决。这是 dxToolbar 的一部分:
{
location: 'after',
widget: 'dxAutocomplete',
options: {
width: '340px',
placeholder: 'Enter title, category or identifier',
dataSource: PageAutoCompleteDataSource($http),
bindingOptions: {
searchText: 'text'
},
onChange: function(e){
console.log('Value searched ' + $scope.searchText);
DevExpress.ui.notify("Searching for " + $scope.searchText);
}
}
}
别管数据源等。我只需要知道如何在任何 onXX 事件中获取当前值?
【问题讨论】:
标签: devextreme