0
我使用jQuery UI的使用_renderMenu和_renderItem与列自动完成按jsfiddlejQuery UI的多栏自动完成更改事件不会被触发
$.widget('custom.mcautocomplete', $.ui.autocomplete, {
_renderMenu: function(ul, items) {
var self = this,
thead;
if (this.options.showHeader) {
table = $('<div class="ui-widget-header" style="width:100%"></div>');
$.each(this.options.columns, function(index, item) {
table.append('<span style="padding:0 4px;float:left;width:' + item.width + ';">' + item.name + '</span>');
});
table.append('<div style="clear: both;"></div>');
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 += '<span style="padding:0 4px;float:left;width:' + column.width + ';">' + item[column.valueField ? column.valueField : index] + '</span>'
});
result = $('<li></li>').data('item.autocomplete', item).append('<a class="mcacAnchor">' + t + '<div style="clear: both;"></div></a>').appendTo(ul);
return result;
}
});
改变,如果我点击自动完成之外没有被触发事件选择任何结果。
但点击标题(列)然后点击外部时,不会触发更改事件。
在此先感谢
难道ÿ你曾经解决过这个问题吗?我有完全一样的。它似乎ui.item:未定义。另外,正如你可以从这个[jsfiddle](http://jsfiddle.net/8CFL4/)看到的,它不能在jQuery UI 1.10中工作,但[工作](http://jsfiddle.net/g4stL/212/ )在jquery 1.8.18中 –