我正在從服務器上獲取json
數據,如1,User,2,Courses,3,Organization
正確,我將這些數據存儲在一個變量實體中,現在我將這個json數據添加到文本字段中用於自動完成,然後允許多個文本框(標籤)的值如下圖所示。typeerror undefined不是函數liferay
,
我越來越喜歡在alert('entities from the 466 line '+e);
typeerror undefined is not a function
異常任何一個能幫助我嗎?
AUI().ready('aui-textboxlist', function(A) {
try {
alert('before calling selectEntities()');
var entities = selectEntities();
console.log(" entities "+entities);
alert("entities from the server "+entities);
entitiesBoxList = new A.TextboxList({
contentBox: '#<portlet:namespace />entitiesDiv',
dataSource: entities,
matchKey: 'name',
schema: {
resultFields: ['id', 'name']
},
queryMatchContains:true,
queryDelimiter : ',',
after: {
render: function() {
try{
var instance_ = this;
var index = 0;
this.entries.insert(index, entry);
}catch (e) {
alert("exception raised at 461 line"+e);
}
}
}
}).render();
} catch(e){
alert('entities from the 466 line '+e);
}
}
如果你註釋掉this.entries這樣的行:'// this.entries.insert(index,entry);',它還會發生嗎?我能想到的另一件事是'.render()'調用正在導致這一點。你的縮進是非常奇怪的,所以很難解釋這個腳本,花些時間重構它使它更具可讀性。您可能會在該過程中發現錯誤。 – Nenotlep 2015-01-21 07:37:31