QUERY: JS CTRL, SHIFT, Context Menu


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: QUERY: JS CTRL, SHIFT, Context Menu

  1. #1
    Join Date
    Mar 2006
    Posts
    24

    QUERY: JS CTRL, SHIFT, Context Menu

    I am wondering if anyone knows good code that implements the Windows Explorer selection mechanism (for a DataGrid or HTML table). I know the basics of assigning attributes to DataGrid rows (eg. objDataGrid.Rows(index).Attributes("onclick")) which applies to HTML tables. But wondering if there's a good technique to do, for example:

    1. Left-click on file/row to select it.
    2. Left-click on a different file/row to select it, reseting previous selections.
    3. Hold down CTRL + left-click on different files/rows to multiple select, thus retaining all selections during CTRL key is down.
    4. Hold down SHIFT + left-click on different file/row and all files/rows between first left-click and second left-click + SHIFT key are selected.
    5. Right-click on one of the selected files/rows brings up a context menu.
    6. Right-click on a non-selected file/row selects it, deselects all others, and brings up context menu.


    I have googled around and there are many examples, especially using the IE's onContextMenu event. However I still haven't found any code/library which does all 6 of the above (all-in-one). I am looking for something which is cross-browser too.

    Anyone seen such a code/library that does the above 6?

  2. #2
    Join Date
    Mar 2006
    Posts
    24
    declarative context menus?

    I have managed to create a nice CTRL, SHIFT selection & context menu system with my DataView (table).

    CTRL select works nicely. However the SHIFT selection always seems to create a drag-selection between the start and ending rows.

    A little reminder. CTRL select is when one holds the CTRL key and mouse left-click on rows to select individual rows (eg. row 1, 3, 5). SHIFT select is when one holds the SHIFT key and left-click on row 1 and then row 10 to automatically select all rows between 1 and 10.

    Does anyone know how to prevent IE & FF from selecting the text inbetween the SHIFT selection phase?


    Currently I use td background-color for selection and knowing what to delete, etc. Is there a better way to do this?

Similar Threads

  1. Disabling right click context menu
    By CFPSoft in forum VB Classic
    Replies: 1
    Last Post: 05-15-2006, 06:34 AM
  2. "Graphical" C# Context menu
    By TabDev in forum .NET
    Replies: 0
    Last Post: 07-27-2005, 08:42 AM
  3. Context Menu Question
    By yigal in forum .NET
    Replies: 1
    Last Post: 07-05-2005, 05:02 PM
  4. Another context menu problem
    By JetserKing in forum VB Classic
    Replies: 0
    Last Post: 02-15-2005, 03:12 PM
  5. Context menu manipulation
    By nnch97 in forum .NET
    Replies: 8
    Last Post: 07-02-2002, 03:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center