dimanche 28 décembre 2014

AUI Auto fields as the tags in liferay6.2


I am displaying data using atuo complete successfully, I am separating the each data by using ',' delimiter, now I have a requirement like , I need to implement like tags for the fields show in the image http://snag.gy/qFEtN.jpg


the below is my code :



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

try {
new A.AutoCompleteList(
{
allowBrowserAutocomplete: 'false',
activateFirstItem: 'true',
inputNode: '#<portlet:namespace />entitiesNames',
resultTextLocator: 'entityName',
render: 'true',
resultHighlighter: 'phraseMatch',
resultFilters:['phraseMatch'],
maxResults: 10,
queryDelimiter : ',',
source:this.get('responseData'),
autoLoad:false,
});
}catch(e) {
alert('not working sudheer: ' + e);
}
}

}
});

});
</aui:script>




Aucun commentaire:

Enregistrer un commentaire