Hi
I am using jquery UI autocomplete in one of my website. What I was looking for is if I could call a variable from the “ui.autocomplete” function’s options array (which is at line #21) to “ui.menu” function (line #459)?
For example, I add an extra variable “myClass”:
$.widget( "ui.autocomplete", {
options: {
[B]myClass: 'highlight',[/B]
appendTo: "body",
autoFocus: false,
delay: 300,
minLength: 1,
position: {
my: "left top",
at: "left bottom",
collision: "none"
},
source: null
},
and I should be able to call that variable somewhere under the “ui.menu” function, like this:
$.widget("ui.menu", {
_create: function() {
var self = this;
this.element
.addClass("ui-menu ui-widget ui-widget-content ui-corner-all " [B]+ parent.options.myClass[/B])
.attr({
role: "listbox",
"aria-activedescendant": "ui-active-menuitem"
})
I tried doing this using the parent.options.myClass syntax but it did not help. Can someone please tell me how to achieve this?
PFA attached .js file.
Thanks