на ajax запрос выдает Uncaught TypeError: undefined is not a function
код
webix.ui({
cols:[
{ view:"list", id:"alist", template:"#name#" },
{ view:"resizer" },
{ view:"list", id:"blist", template:"#name#" }
]
});
var data = {"id":"70","name":"text","user_date":"0000-00-00 00:00:00","ip":"209.244.0.3","comments":[{"post_id":"70","name":"Ahtung","topic_date":"2015-02-13 21:00:00","place":"Xer","ip":"111"}]};
$$("alist").parse(data);
$$("blist").parse( webix.ajax("services/forum.php?id=70").then(function(data){
return data.comments;
}))
колонка A ок, B пустота
Обращение к файлу forum.php есть
вывод данных есть
{“id”:“70”,“name”:“text”,“user_date”:“0000-00-00 00:00:00”,“ip”:“209.244.0.3”,“comments”:[{“post_id”:“70”,“name”:“Ahtung”,“topic_date”:“2015-02-13 21:00:00”,“place”:“Xer”,“ip”:“111”}]}
но ошибка в консоле
Uncaught TypeError: undefined is not a function(index):366 (anonymous function)webix_debug.js:525 webix.EventSystem.callEvent(index):265 webix.ui.body.rows.on.onItemClickwebix_debug.js:525 webix.EventSystem.callEventwebix_debug.js:17219 webix.protoUI.Ycwebix_debug.js:5444 webix.MouseEvents.Scwebix_debug.js:239 (anonymous function)
А такой код выдает Успех, но и ничего не выводит в blist
$$("blist").parse( webix.ajax("services/forum.php?id=70", {
error:function(text, data, XmlHttpRequest){
alert("error");
},
success:function(text, data, XmlHttpRequest){
alert("success");
return data.comments;
}
}));