Created
October 24, 2012 14:54
-
-
Save miyohide/3946532 to your computer and use it in GitHub Desktop.
dynatreeサンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Dynatree Sample</title> | |
<link rel="stylesheet" href="./src/skin/ui.dynatree.css" /> | |
<script type="text/javascript" src="./jquery/jquery.js"></script> | |
<script type="text/javascript" src="./jquery/jquery-ui.custom.js"></script> | |
<script type="text/javascript" src="./jquery/jquery.cookie.js"></script> | |
<script type="text/javascript" src="./dist/jquery.dynatree.min.js"></script> | |
<script type="text/javascript"> | |
$(function(){ | |
$('#add').click(function(){ | |
var start_time = +new Date(); | |
var target = $('#tree').dynatree('getTree').getNodeByKey('id1'); | |
for (var i = 0; i < 1000; i++) { | |
target.addChild({title: "sub-" + i}); | |
} | |
var end_time = +new Date(); | |
console.log(end_time - start_time); | |
}); | |
$('#tree').dynatree(); | |
}); | |
</script> | |
</head> | |
<body> | |
<div id="tree"> | |
<ul id="treeData" style="display: none;"> | |
<li id="id1" class="folder">フォルダ | |
<ul> | |
</ul> | |
</li> | |
</ul> | |
</div> | |
<button id="add">要素追加</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment