我正确地json
从服务器获取数据,1,User,2,Courses,3,Organization
我将这些数据存储在变量实体中,现在我正在为文本字段添加这个 json 数据以自动完成,然后允许文本框(选项卡)有多个值,如下所示图片。
,
我得到了typeerror undefined is not a function
像alert('entities from the 466 line '+e);
谁能帮我?
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);
}
}