掲示板
Turn off case-sensetivity for aui-autocomplete
12年前 に Yannick Weinz によって更新されました。
Turn off case-sensetivity for aui-autocomplete
Junior Member 投稿: 69 参加年月日: 10/11/15 最新の投稿
Hi all,
how can i turn off the case-sensitivity for the aui-autocomplete?
We're using an AJAX call for the dataSource and somehow this causes the autocompletion to be case sensitive (even when i write "queryMatchCase: false"). Is there any trick to it?
This is, how it looks right now (i removed the "queryMatchCase..." because it didn't seem to do anything):
Hope anyone can help me.
Greetings,
Yannick
how can i turn off the case-sensitivity for the aui-autocomplete?
We're using an AJAX call for the dataSource and somehow this causes the autocompletion to be case sensitive (even when i write "queryMatchCase: false"). Is there any trick to it?
This is, how it looks right now (i removed the "queryMatchCase..." because it didn't seem to do anything):
function initializeAutoCompletion(url, namespace, contentBoxID, inputID, focusAndClearOnFocus){
AUI().use('aui-autocomplete', 'aui-node', function(A){
setTimeout(function(){
var node = A.one('#' + inputID);
if(focusAndClearOnFocus){
node.attr('onfocus','');
}
var remoteData = new A.DataSource.IO({
source: url
});
remoteData.plug(
A.Plugin.DataSourceJSONSchema, {
schema: {
resultListLocator: 'completions',
resultFields: ['value']
}
}
);
var autocomplete = new A.AutoComplete({
dataSource: remoteData,
schema: {
resultListLocator: 'completions',
resultFields: ['value']
},
matchKey: 'value',
delimChar: ' ',
typeAhead: false,
contentBox: '#' + contentBoxID,
input: '#' + inputID,
useShadow: true
});
if(focusAndClearOnFocus){
autocomplete.on('renderedChange',function(evt){
setTimeout(function(){
node.focus();
node.val(node.val());
}, 0);
});
}
autocomplete.generateRequest = function(query) {
return { request: '&' + namespace + 'prefix=' + query };
};
autocomplete.render();
node.focus();
},0);
});
return true;
}
Hope anyone can help me.
Greetings,
Yannick