我使用此脚本使用自动完成列表显示地址列表。所有内容似乎都正常工作。我的地址表只有3个条目,但它显示了一些以前的值。如何摆脱这个问题:
<aui:script>
AUI().use('autocomplete-list', 'aui-base', 'aui-io-request', 'autocomplete-filters', 'autocomplete-highlighters', function(A) {
A.io.request('<%=getAddress%>', {
dataType: 'json',
method: 'GET',
on: {
success: function() {
continents = this.get('responseData');
A.one('#<portlet:namespace/>addressNumberTosave').val(continents[0].addressNumber);
A.one('#<portlet:namespace/>addressAutocomplete').val(continents[0].address);
var address_ac = new A.AutoCompleteList({
allowBrowserAutocomplete: 'false',
enableCache: 'false',
activateFirstItem: 'true',
inputNode: '#<portlet:namespace/>addressAutocomplete',
resultTextLocator: 'address',
resultHighlighter: ['phraseMatch'],
resultFilters: ['phraseMatch'],
render: 'true',
source: this.get('responseData'),
});
address_ac.on('select', function(e) {
var selected_node = e.itemNode,
selected_data = e.result;
A.one('#<portlet:namespace/>addressNumberTosave').val(e.result.raw.addressNumber);
});
}
}
});
});
</aui:script>
我尝试过allowBrowserAutocomplete:&#39; false&#39 ;,enableCache:&#39; false&#39;属性,但没有用。如何解决这个问题?
答案 0 :(得分:0)