Foros de discusión

AUI auto completeis not working in Liferay6.2

sudheer kumar, modificado hace 9 años.

AUI auto completeis not working in Liferay6.2

Junior Member Mensajes: 54 Fecha de incorporación: 25/09/13 Mensajes recientes
Hi all,

I have followed the http://www.liferaysavvy.com/2014/02/liferay-aui-auto-complete-list.html for auto complete, this is my code: in the below code alert('jsonArray came: ' + jsonArray); is printing data correctly.it is printing like objJsonArray:....[{"roleName":"Organization User","roleId":10147},{"roleName":"Site Admin","roleId":16883},{"roleName":"Student","roleId":18139},{"roleName":"Parent","roleId":18146},{"roleName":"Faculty","roleId":18153},{"roleName":"SchooloneStudent","roleId":27701}] but from new A.AutoCompleteList it is not working. can any one help me?

<aui:script>
AUI().use('autocomplete-list','aui-base','aui-io-request','autocomplete-filters','autocomplete-highlighters',function (A) {
A.io.request('<%=getRoles%>',{
dataType: 'json',
method: 'GET',
on: {
success: function(event, id, obj) {

var instance = this ;
var data = instance.get('responseData');
var jsonArray = JSON.stringify(data);
alert('result came: ' + data);
alert('jsonArray came: ' + jsonArray);
try {
new A.AutoCompleteList(
{
allowBrowserAutocomplete: 'false',
activateFirstItem: 'true',
inputNode: '#<portlet:namespace />ListOfRoles',
resultTextLocator: 'roleName',
render: 'true',
resultHighlighter: 'phraseMatch',
resultFilters:['phraseMatch'],
source:jsonArray,
});
}catch(e) {
alert('not working : ' + e);
}
}

}
});

});
</aui:script>
sudheer kumar, modificado hace 9 años.

RE: AUI auto completeis not working in Liferay6.2

Junior Member Mensajes: 54 Fecha de incorporación: 25/09/13 Mensajes recientes
I have found solution here....!

http://stackoverflow.com/questions/27631595/auto-complete-not-working-liferay-6-2/27631898#27631898