我正在从服务器上获取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