JavaScript.CoolDev.Com Support Forums

Any questions related to JavaScript menu and JavaScript tree menu by Javascript.CoolDev.Com

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Getting the selected node

 
Post new topic   Reply to topic    JavaScript.CoolDev.Com Forum Index -> COOLjsTree
Author Message
Torquemada



Joined: 14 Sep 2004
Posts: 11

PostPosted: Sun Sep 19, 2004 1:20 pm    Post subject: Getting the selected node Reply with quote

Using COOLjsTreePRO version 2.4.3, I want to refer to the selected node when my tree is initialised, so that I can synchronise another page. But the "selectedNode" property of the tree is undefined. I can get the "rootNode" and "name" properties ok.

Sample code:

Code:
<script language="JavaScript">
    tree1.init();
    alert("Selected node: " + tree1.selectedNode.index);
</script>


Is there a way I can get a reference to the currently selected node? Or perhaps I must read it from the "<treename>Selected" cookie like below? (Code shamelessly copied from cooltreepri.js) :

Code:
var selIndex = document.cookie.match(new RegExp('(\\W|^)' + "myTreeSelected" + '=([^;]+)')) ? RegExp.$2 : null;

Thanks for any advice.
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Wed Nov 17, 2004 7:28 pm    Post subject: Reply with quote

There is no selectedNode property anymore. Instead tree since 2.4.8 has getSelectedNode() method wich returns last selected node or null.
Back to top
Torquemada



Joined: 14 Sep 2004
Posts: 11

PostPosted: Thu Nov 18, 2004 10:52 am    Post subject: Reply with quote

Alex_Kunin wrote:
There is no selectedNode property anymore. Instead tree since 2.4.8 has getSelectedNode() method wich returns last selected node or null.

Aha, thanks.

Alex is updated documentation describing the new methods and properties of versions 2.4.+ available?
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Thu Nov 18, 2004 11:14 am    Post subject: Reply with quote

Alas, no, it is not available. Current docs describe latest stable version 2.3.1. Please, understand my position: I can't write documentation while features are being changed on every small release. Probably, we have to fix current set of features, kill all bugs, and then make a release + new docs. But there are still a lot of things to do with current version 2.5.2:

  • Tree state saving in dynamic environment (at least ability to save state by id - not by index)
  • huge trees - problems with images' refresh
  • item drag-n-drop
  • explorer-like mode + text wrapping (ugly gaps)
  • after deleting node its onmouseout handler will not be called, and because of this status bar text will remain

May be some more, I can't recall right now.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    JavaScript.CoolDev.Com Forum Index -> COOLjsTree All times are GMT
Page 1 of 1