PDA

View Full Version : TreePanel Node Checked ... how to turn on/off programmatically?



pete7au
3 Oct 2010, 3:55 PM
Hi,

Hoping there is an easy answer to this one ... can set 'checked' on a node at construction but not programmatically at runtime? Simple test case / example below ...


<html>
<head>
<title>Test</title>
<link rel="stylesheet" type="text/css" href="ext-3.2.1/resources/css/ext-all.css" />
<script type="text/javascript" src="ext-3.2.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext-3.2.1/ext-all-debug.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
var tree = new Ext.tree.TreePanel({
renderTo:'Test',
title: 'Test',
useArrows:true,
rootVisible: true,
root: {
text: 'Root',
children:
[
{
text:'Child 1',
leaf: true,
//checked: false
}
]
}
});

tree.getRootNode().expand(true);
tree.getRootNode().firstChild.attributes.checked = false;
});
</script>
</head>
<body>
<div id="Test"></div>
</body>
</html>

rockskull
21 Feb 2014, 12:18 PM
I've been searching for this all day and haven't came up with a solution.

It's not possible that a simple thing like this one is so difficult to achieve.