problem s kniznicou jquery – jquery.dynatree.js
Upozornění: Tohle vlákno je hodně staré a informace nemusí být platné pro současné Nette.
- maria288
- Člen | 38
Ahojte,
mam jeden problem s kniznicou jquery.dynatree.js
snazim sa na stranku vlozit strom kniznice jquery.dynatree.js
nalinkujem
<link rel="stylesheet" id="skinSheet" href="{$baseUri}/css/ui.dynatree.css" type="text/css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="{$baseUri}/js/jquery/jquery.dynatree.js"></script>
<script type="text/javascript" src="{$baseUri}/js/jquery/jquery.cookie.js"></script>
<script type="text/javascript" src="{$baseUri}/js/jquery/jquery-ui.custom.js" ></script>
a vyhodi mi chybu
SCRIPT438: Objekt nepodporuje vlastnosť alebo metódu widget
jquery.dynatree.js, riadok2705 znak1
SCRIPT5007: Nedá sa získať hodnota vlastnosti nodedatadefaults: objekt má
hodnotu null alebo nie je definovaný
realvea_sk, riadok313 znak5
pricom do html stranky vlozim
<div id="tree2" >
</div>
$.ui.dynatree.nodedatadefaults["icon"] = false; // Turn off icons by default
$("#tree2").dynatree(
{
checkbox: true,
selectMode: 3,
children: treeData,
fx: { height: "toggle", duration: 200 } ,
autoCollapse: false,
onSelect: function(select, node)
{
// Display list of selected nodes
var selNodes = node.tree.getSelectedNodes();
// convert to title/key array
var selKeys = $.map(selNodes, function(node)
{
var idecka = "[" + node.data.key + "]";
return idecka;
} );
$("#echoSelection1").text(selKeys.join(", ") );
} ,
onClick: function(node, event)
{
// We should not toggle, if target was "checkbox", because this
// would result in double-toggle (i.e. no toggle)
if( node.getEventTargetType(event) == "title" )
node.toggleSelect();
} ,
onKeydown: function(node, event)
{
if( event.which == 32 )
{
node.toggleSelect();
return false;
}
} ,
// The following options are only required, if we have more than one tree on one page:
cookieId: "dynatree-Cb1",
idPrefix: "dynatree-Cb1-"
} );
$("#btnDeselectAll").click(function() {
$("#tree2").dynatree("getRoot").visit(function(node) {
node.select(false);
} );
return false;
} );
$("#btnSelectAll").click(function() {
$("#tree2").dynatree("getRoot").visit(function(node) {
node.select(true);
} );
return false;
} );
<!-- Start_Exclude: This block is not part of the sample code -->
/* $("#skinCombo")
.val(0) // set state to prevent caching
.change(function() {
var href = "../src/"
+ $(this).val()
+ "/ui.dynatree.css"
+ "?reload=" + new Date().getTime();
$("#skinSheet").attr("href", href);
} ); */
<!-- End_Exclude -->
$('#imgclose').live("click", function() {
var tree = document.getElementById('nav-tree2');
tree.style.display= "none";
} );