- 注册时间
- 2015-9-13
- 最后登录
- 1970-1-1
- 阅读权限
- 10
- 积分
- 100
- 精华
- 0
- 帖子
- 28
|
新手上路 我这个怎么赋值呢 请解释
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="width=device-width" />
<title>tree</title>
<link href="~/MiniUis/demo.css" rel="stylesheet" />
<script src="~/MiniUis/scripts/boot.js"></script>
</head>
<body>
<h4>Tree大数据量:10000</h4>
<div id="treegrid1" class="mini-treegrid" style="width:100%;height:350px;"
showtreeicon="true" url="/home/show"
treecolumn="taskname" idfield="id" parentfield="ParentTaskUID" resultastree="false">
<div property="columns">
<div type="indexcolumn"></div>
<div name="taskname" field="name" width="200">任务名称</div>
<div field="name" width="100">用户名</div>
<div field="pwd" width="100">密码</div>
<div field="id" width="100">id</div>
</div>
</div>
</body>
</html>
<script type="text/javascript">
// var sss = new Date();
// window.onload = function () {
// setTimeout(function () {
// alert(new Date() - sss);
// }, 1);
// };
mini.parse();
//造10000个节点:4个层级,每层级10节点
function createTreeData() {
var index = 0;
function create(pid, level) {
var data = [];
for (var i = 0, l = 10; i < l; i++) {
var o = {};
index++;
var o = {
"UID": index,
"ParentTaskUID": pid,
"Name":name,
"Duration": 5,
"Start": "2007-01-01",
"Finish": "2007-01-05",
"PercentComplete": 0,
"Summary": 1,
"Critical": 0,
"Milestone": 0,
"PredecessorLink": []
};
if (level > 0) {
o.children = create(o.UID, level - 1);
}
data.push(o);
}
return data;
}
var data = create("", 3);
return data;
}
var data = createTreeData();
var tree = mini.get("treegrid1");
tree.setData(data);
alert(data);
alert(tree);
</script>
public string show()
{
string key = Request["key"];
string where = "";
if(key != null) //条件查询
{
where = "name like '%" + key + "%'";
}
List<model.Class1> li = sql.GetListModel<model.Class1>("Class1", "*", where);
string json = sql.ListToJsonString<model.Class1>(li); //转换json字符串
int count = li.Count();
//转依字符串 miniui传回去的数据只支持data不支持rows
json = "{\"total\":" + count + ",\"data\":" + json + "}";
return json;
}
|
|