Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Bill Jindrich on Jul 09, 2008 07:02
open dhtmlx forum
dhtmlxTree: any way to automatically have keyboard navigation function correctly immediately after page load?

sorry - I sent the wrong email address again - this submission has the correct email

I am trying to use enableKeyboardNavigation in dhtmlxTree. I have custom code that will automatically select the correct item in the tree when a page is loaded. What I'm seeing is that, even though an item in the tree is visually selected, the arrow keys cannot be used to select navigate the tree until I first click on an item in the tree. Is there any way to have the keyboard navigation function immediately, without needing to first click on an item?

When loading the page, I call these functions on the tree, in the specified order, as part of the code that is passed to parameter #2 of loadXML():
loadOpenStates(), selectItem(), focusItem(), and openItem()
Answer posted by Support on Jul 09, 2008 07:49
>>without needing to first click on an item?
The tree is not active by default, you can switch focus to it , with next code
    tree.enableKeyboardNavigation(true);
    tree.parentObject.lastChild.focus();   //move keyboard focus in tree