0
col1I've一直試圖每幾點建議jQuery的自動完成編輯器中添加到我的SlickGrid(2.0),但我不斷收到一個錯誤:jquery的自動完成發行
Object doesn't support this property or method
這裏就是我試圖啓動搭配:
(function($) {
// register namespace
$.extend(true, window, {
"Slick": {
"Editors": {
"Auto": AutoCompleteEditor,
"SelectDD": SelectBoxEditor,
"Select": SelectBoxEditor2,
"Text": TextEditor,
"Text2": IntegerCellEditor
}
}
});
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();
}
,這裏是網格的相關部分:
var columns = [
{id:"col1", name:"test", field:"col1", width:135, editable:true, cssClass:"pad-4-left", sortable:true, editor:Slick.Editors.Auto},
我已經包括什麼據說是依賴:
<link rel="stylesheet" type="text/css" href="css/jquery-ui.css" media="all" />
<script type="text/javascript" src="js/jquery/jquery-1.8.3.js"></script>
<script type="text/javascript" src="js/jquery/jquery-ui.js"></script>
任何建議將是偉大的。
感謝