Home - Forums-.NET - FlyTreeView (ASP.NET) - Tree view Navigation Short Cut keys

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

Tree view Navigation Short Cut keys
Link Posted: 16-Jan-2008 23:08
I want to handle different short cut key while navigating within the tree view.
Is it possible to use short cut keys in FlyTreeView
e.g
    I want to delete a node and have context menu which deletes that node but I want to utilize my delete key on key board to perform this task
Link Posted: 17-Jan-2008 01:20
Probably you can try to add your custom document keydown handler and handle delete key to delete currently selected node (for example).
Current FlyTreeView version does not contain built-in feature to provide the same functionality.
Link Posted: 31-Mar-2008 23:08
Right now we can use arrow keys to navigate within treeview or collapse or expand treeview.
How you guys capture these values and how you treeview is responding to them?
Link Posted: 31-Mar-2008 23:39
We're just handling keydown event of treeview element and use event keycode (which property for nonIE engines) to determine action.
Link Posted: 01-Apr-2008 00:23
can you post a code snippet for example?
Link Posted: 01-Apr-2008 00:46
We're using a small and useful function to convert event of any supported browser into our own internal event object (thus we do not need to deal with multiple browsers every time when we need to handle some event).

For your case, you just need to get the key code for the keydown event:
function FTVonkeydown(event)
{
    var keycode = window.event ? window.event.keyCode : event.which;
    //and then switch through values that you need to handle:
    //for example in case of DOWN button keycode is 40
    
    // if no suitable keycode found - return true so default action will proceed.
    // otherwise - return false and call event.preventDefault()
}


like this.