尝试加载JSON数组时未定义的webix树表

时间:2017-08-22 03:22:34

标签: json webix webix-treetable

<ul class="list-inline row">
<li class="col-sm-4">
    <div class="col-sm-4"><img src="//placehold.it/150x100" class="img-responsive"></div>
    <div class="col-sm-4"><img src="//placehold.it/150x100" class="img-responsive"></div>
    <div class="col-sm-4"><img src="//placehold.it/150x100" class="img-responsive"></div>
</li>
<li class="col-sm-4">
    <div class="col-sm-4"><img src="//placehold.it/150x100" class="img-responsive"></div>
    <div class="col-sm-4"><img src="//placehold.it/150x100" class="img-responsive"></div>
    <div class="col-sm-4"><img src="//placehold.it/150x100" class="img-responsive"></div>
</li>
<li class="col-sm-4">
    <div class="col-sm-4"><img src="//placehold.it/150x100" class="img-responsive"></div>
    <div class="col-sm-4"><img src="//placehold.it/150x100" class="img-responsive"></div>
    <div class="col-sm-4"><img src="//placehold.it/150x100" class="img-responsive"></div>
</li>

我正在使用这个,我的数据来自python文件(我的意思是<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/> <div class="container"> <ul class="list-inline row"> <li class="col-sm-4"> <div class="col-sm-4"><img src="//placehold.it/150x100" class="img-responsive"></div> <div class="col-sm-4"><img src="//placehold.it/150x100" class="img-responsive"></div> <div class="col-sm-4"><img src="//placehold.it/150x100" class="img-responsive"></div> </li> <li class="col-sm-4"> <div class="col-sm-4"><img src="//placehold.it/150x100" class="img-responsive"></div> <div class="col-sm-4"><img src="//placehold.it/150x100" class="img-responsive"></div> <div class="col-sm-4"><img src="//placehold.it/150x100" class="img-responsive"></div> </li> <li class="col-sm-4"> <div class="col-sm-4"><img src="//placehold.it/150x100" class="img-responsive"></div> <div class="col-sm-4"><img src="//placehold.it/150x100" class="img-responsive"></div> <div class="col-sm-4"><img src="//placehold.it/150x100" class="img-responsive"></div> </li> </ul> </div>)。

python func返回一个JSON数组。当我在树中使用它时,它将值显示为undefined。有人可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

你可以使用ajax获取json数组,并将其分配给js对象。而不是写作  url: "my_python_func()",您只需输入data: jsobject

即可