$.widget('custom.mcautocomplete', $.ui.autocomplete, { _create: function () { this._super(); this.widget().menu("option", "items", "> :not(.ui-widget-header)"); }, _renderMenu: function (ul, items) { var self = this, thead; if (this.options.showHeader) { table = $('
'); $.each(this.options.columns, function (index, item) { table.append('' + item.name + ''); }); table.append('
'); ul.append(table); } $.each(items, function (index, item) { self._renderItem(ul, item); }); }, _renderItem: function (ul, item) { var t = '', result = ''; $.each(this.options.columns, function (index, column) { t += '' + item[column.valueField ? column.valueField : index] + '' }); result = $('
  • ') .data('ui-autocomplete-item', item) .append('' + t + '
    ') .appendTo(ul); return result; } });