Results 1 to 9 of 9

Thread: How to disbale control (ctrl) key on hyperlink?

  1. #1

    Default How to disbale control (ctrl) key on hyperlink?

    Hi,

    I want to disable control key on hyperlink. I mean, when user keep pressing ctrl key and click on hyperlink, that hyperlink should not work means user can click on hyperlink without pressing ctrl key.

    How, to achieve this think?

    Thanks in Advance
    Livinglegends

  2. #2

    Default

    no body?

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Add a document click listener using delegate: 'a'

    Cancel the event if the CTRL button is pressed (The EventObject tells you this)

  4. #4

    Default

    Quote Originally Posted by Animal View Post
    Add a document click listener using delegate: 'a'

    Cancel the event if the CTRL button is pressed (The EventObject tells you this)

    Can you give some more details to implement it or some code hint regarding this?

  5. #5
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Step by step. Add a document click listener. Do that and show code.

  6. #6
    Sencha User fay's Avatar
    Join Date
    Apr 2007
    Location
    Ireland
    Posts
    1,750

    Default

    Take a look at Ext.select and then search the forums for how it has been used with the 'click' event.

  7. #7
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    I would say delegation would be better than that for a couple of reasons.

    1. A CompositeElement still performs the called method on each and every member, so that would be maybe dozens, but perhaps more click listeners.
    2. If you add more <a> elements after you first collect them, they won't be handled (unless you do it again... only adding newly added <a> elements)

  8. #8
    Sencha User fay's Avatar
    Join Date
    Apr 2007
    Location
    Ireland
    Posts
    1,750

    Default

    ^^ ahh, that never occurred to me. Ta, nice to learn something new!

  9. #9
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    So Ledge, old chap. Have you god a document click listener added?

Similar Threads

  1. Capture key combination (e.g.: CTRL + S)
    By ajlaluan in forum Ext 3.x: Help & Discussion
    Replies: 6
    Last Post: 5 Apr 2010, 3:54 AM
  2. Determine Ctrl key wuth D&D
    By nagir in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 10 Jul 2008, 3:42 PM
  3. Multiple Cell Select in a Grid without CTRL key
    By mess in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 12 Dec 2007, 10:05 AM
  4. Tree multiple selection without ctrl key
    By Jacob in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 15 Nov 2007, 10:20 AM
  5. Problem with ctrl+key mapping in Safari
    By haibijon in forum Ext 1.x: Bugs
    Replies: 0
    Last Post: 13 May 2007, 6:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •