out/artifacts/yuangong/assets/js/fuelux/data/fuelux.tree-sampledata.js
(完整代码) 945Bvar DataSourceTree = function(options) {
this._data = options.data;
this._delay = options.delay;
}
DataSourceTree.prototype.data = function(options, callback) {
var self = this;
var $data = null;
if(!("name" in options) && !("type" in options)){
$data = this._data;//the root tree
callback({ data: $data });
return;
}
else if("type" in options && options.type == "folder") {
if("additionalParameters" in options && "children" in options.additionalParameters)
$data = options.additionalParameters.children;
else $data = {}//no data
}
if($data != null)//this setTimeout is only for mimicking some random delay
setTimeout(function(){callback({ data: $data });} , parseInt(Math.random() * 500) + 200);
//we have used static data here
//but you can retrieve your data dynamically from a server using ajax call
//checkout examples/treeview.html and examples/treeview.js for more info
};
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
