Skip to content

Redirecting based on suggestion list #458

@saravanamani1999

Description

@saravanamani1999
var options = {
	url: "https://saravanamani1999.github.io/api/moduleInfo.json",

	getValue: "moduleCode",

	adjustWidth: false,

	template: {
		type: "description",
		fields: {
			description: "title"
		}

	},

	list: {
		maxNumberOfElements: 10,
		match: {
			enabled: true
		},
		showAnimation: {
			type: "slide", //normal|slide|fade
			time: 300,
			callback: function() {}
		},

		hideAnimation: {
			type: "slide", //normal|slide|fade
			time: 300,
			callback: function() {}
		},
		onClickEvent: function(event, ui) {
			// alert("click");
			location.href = "http://localhost:3000/modules/" + moduleCode
		}
	},
	theme: "round"
};

`$("#search-bar").easyAutocomplete(options);

Hi, im currently trying to redirect my webpage based on the suggestion list based on my json api. So onClickEvent, i want it to redirect to the "http://localhost:3000/modules/" followed by the item clicked which is moduleCode. Any help would be much appreciated. Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions