I use
$.extend($.fn.datagrid.defaults.filters, {
tagbox: {
init: function (container, options) {
var input = $('<input>').appendTo(container);
input.tagbox($.extend({
selectOnNavigation: true,
panelHeight: 'auto',
hasDownArrow: true,
limitToList: true
}, options || {}));
console.log('init');
return input;
},
setValue: function (target, value) {
console.log('setValue');
if (value) {
$(target).tagbox('setValues', value);
} else {
$(target).tagbox('clear');
}
},
getValue: function (target) {
console.log('getValue');
return $(target).tagbox('getValues');
},
resize: function (target, width) {
console.log('resize');
$(target).tagbox('resize', width);
},
destroy: function (target) {
console.log('destroy');
$(target).tagbox('destroy');
}
}
});$(target).tagbox('setValues', value); return bug
Uncaught TypeError: can't access property "textbox", $.data(...) is undefined
$(target).tagbox('clear'); return bug
Uncaught TypeError: can't access property "options", $.data(...) is undefined