Closed Ciwan1859 closed 10 years ago
Is this my code or your code? As for this.box being undefined, check your reference and see what the this
keyword points to.
Hi Samuel, Merci for the reply.
Assuming you're the only one working on VisualSearch.js, then yes this would be your code :)
I did as you suggested, and placed a break-point in Chrome debugger on that line, and got the following:
The code again is below:
this.box.data('ui-autocomplete')._renderMenu = function(ul, items) {
var category = '';
_.each(items, _.bind(function(item, i) {
if (item.category && item.category != category) {
ul.append('<li class="ui-autocomplete-category">'+item.category+'</li>');
category = item.category;
}
if(this._renderItemData) {
this._renderItemData(ul, item);
} else {
this._renderItem(ul, item);
}
}, this));
};
It turns out my dependencies were not correct in terms of their versions.
Note to everyone reading this ... to ensure you get no headaches, use the dependencies file that comes with the download of Visual Search.
Thanks
Hello
I have never used this before, but thought I would give it a try. I have added all required dependencies (latest of each), but when I run my page, I get the following error:
TypeError: this.box.data(...) is undefined.
The line of code is:
// Renders the results grouped by the categories they belong to. this.box.data('ui-autocomplete')._renderMenu = function(ul, items) { var category = '';
Any help would be greatly appreciated.
Thank You.