Foros de discusión

Unable to use autocomplete and calender feature simultaneouly.

Ravi Golia, modificado hace 11 años.

Unable to use autocomplete and calender feature simultaneouly.

New Member Mensajes: 9 Fecha de incorporación: 22/12/12 Mensajes recientes
While creating form in liferay portal using calender along with autocomplete, it does not take place...
thumbnail
Juhi Kumari, modificado hace 11 años.

RE: Unable to use autocomplete and calender feature simultaneouly.

Expert Mensajes: 347 Fecha de incorporación: 12/12/11 Mensajes recientes
Hi Ravi,
Using AUI you can use auto-complete and calendar simultaneouly, like this,
AUI().ready('aui-autocomplete','aui-calendar', function(A) {
	
	 var states = [
	 	['AL', 'Alabama', 'The Heart of Dixie'],
		['AK', 'Alaska', 'The Land of the Midnight Sun'],
		['AZ', 'Arizona', 'The Grand Canyon State'],
		['AR', 'Arkansas', 'The Natural State'],
		['CA', 'California', 'The Golden State'],
		['CO', 'Colorado', 'The Mountain State'],
		['CT', 'Connecticut', 'The Constitution State']
	 ];
	 var autoComplete = new A.AutoComplete({
	 	contentBox : '#auto',
	 	dataSource : states,
	 	delimChar : ',',
	 	matchKey : 'name',
	 	typeAheaad : true,
	 	schema :{
	 		resultFields :['key','name', 'description']
	 	}
	 }).render();

       var calendar = new A.Calendar(
		{
			allowNone: false,
			dateFormat: '%d/%m/%y %A',
			dates: [ '09/14/2009', '09/15/2009' ],
			firstDayOfWeek: 1,
			maxDate: '09/25/2009',
			minDate: '09/05/2009',
			selectMultipleDates: true,
			setValue: true,
			showToday: false
		}
	)
	.render('#demo');

	


where demo and auto are the div id.

Regards
Juhi