我想在Kendo Combobox中一起使用DataBound和AutoBind。 但無法使用它。 我的DataBound用於插入第一個項目到列表中,如果我使用AutoBind ='false',那麼我無法設置它。如何使用Databound和AutoBind一起用於Kendo Combobox
$("#Number").kendoComboBox({
dataTextField: "NUM",
dataValueField: "ID",
filter: "startwith",
autoBind: false,
suggest:true,
minLength: 5,
dataBound: function() {
var dataSource = this.dataSource;
var data = dataSource.data();
if (!this._adding) {
this._adding = true;
if (IS_ANALYST == 'Y') {
dataSource.insert(0, {
"NUM": "Create New Analysis",
"ID": -1
});
this.select(function (dataItem) {
return dataItem.NUM === "Create New Analysis";
});
}
else {
dataSource.insert(0, {
"NUM": "Select",
"ID": -2
});
this.select(function (dataItem) {
return dataItem.NUM === "Select";
});
}
this._adding = false;
}
},
});
那麼如何解決這個問題。 我想使用AutoBind ='false'並且還需要插入第一個項目,如圖所示 對此的任何替代方法? 在此先感謝!
感謝answer..I通過使用不同的方法解決了這個問題..我已經發布了答案.. – SantyEssac