DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  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, 05:34 AM
  2. "Graphical" C# Context menu
    By TabDev in forum .NET
    Replies: 0
    Last Post: 07-27-2005, 07:42 AM
  3. Context Menu Question
    By yigal in forum .NET
    Replies: 1
    Last Post: 07-05-2005, 04:02 PM
  4. Another context menu problem
    By JetserKing in forum VB Classic
    Replies: 0
    Last Post: 02-15-2005, 02:12 PM
  5. Context menu manipulation
    By nnch97 in forum .NET
    Replies: 8
    Last Post: 07-02-2002, 02:09 PM

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links