hice esto en slick.editors.js - podría tener algunos errores, pero debería trabajar y ayudar a empezar:
$.extend(true, window, {
"Slick": {
"Editors": {
"Auto": AutoCompleteEditor,
"Text": TextEditor,
"Integer": IntegerEditor,
"Date": DateEditor,
"YesNoSelect": YesNoSelectEditor,
"Checkbox": CheckboxEditor,
"PercentComplete": PercentCompleteEditor,
"LongText": LongTextEditor
}
}
});
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
function AutoCompleteEditor(args) {
var $input;
var defaultValue;
var scope = this;
var calendarOpen = false;
this.init = function() {
$input = $("<INPUT id='tags' class='editor-text' />");
$input.appendTo(args.container);
$input.focus().select();
$input.autocomplete({
source: availableTags
});
};
this.destroy = function() {
$input.autocomplete("destroy");
};
this.focus = function() {
$input.focus();
};
this.loadValue = function (item) {
defaultValue = item[args.column.field];
$input.val(defaultValue);
$input[0].defaultValue = defaultValue;
$input.select();
};
this.serializeValue = function() {
return $input.val();
};
this.applyValue = function (item, state) {
item[args.column.field] = state;
};
this.isValueChanged = function() {
return (!($input.val() == "" && defaultValue == null)) && ($input.val() != defaultValue);
};
this.validate = function() {
return {
valid: true,
msg: null
};
};
this.init();
}
Déjame saber si esto ayuda.
Hola ganeshk, eso fue exactamente lo que quería ... gracias ... sin embargo ... se siempre se informa en la consola Firebug "$ input.autocomplete no es una función". Cualquier cosa que hice, no encuentra autocompletar. Mientras leo, autocompare es parte de jquery-ui-1.8. ¿Derecha? ¿Alguna pista de lo que podría hacer? – user1596343
Me alegro de ser de ayuda, y bienvenido a SO! Solo incluye 'jquery-ui.js' y' jquery-ui.css' en tu HTML. Puede descargar ambos desde http://www.jqueryui.com – ganeshk
Espero que esto haya respondido a su pregunta. ¿Te importaría aceptar esto como tu respuesta entonces? – ganeshk