1. #1
    Sencha User
    Join Date
    May 2010
    Location
    Las Vegas, NV
    Posts
    132
    Answers
    7
    Vote Rating
    2
    billtricarico is on a distinguished road

      0  

    Default Answered: IntelliSense in TextArea

    Answered: IntelliSense in TextArea


    Are there any examples of this?

    Let's say you have a standard TextArea component. As you type, or if you hit a keyboard combination (like CTRL+Space) then a ComboBox would pop up by the cursor. This is a common situation in IDEs like Visual Studio, IntelliJ IDEA, etc.

    Thanks.

  2. So what I have come to realize is that it's not a trivial solution.

    Here is an example:

    http://enobrev.info/cursor/

    This article provides insight into this interesting problem:

    http://stackoverflow.com/questions/128342/display-div-at-cursor-position-in-textarea

  3. #2
    Sencha User lorezyra's Avatar
    Join Date
    Dec 2007
    Location
    Japan -- 日本
    Posts
    531
    Answers
    6
    Vote Rating
    3
    lorezyra will become famous soon enough

      0  

    Default


    Use the triggerField and just hide the trigger. This will effectively provide the functionality you desire.


    Here's a good example: http://docs.sencha.com/ext-js/4-0/#!...um-search.html
    Perfection as a goal is a nice idea that can point one in a specific direction. However, since "perfection" is an ever changing (evolving?) and moving target, one must admit that perfection can never be obtained...

    When in doubt, check the d4mn source code!

  4. #3
    Sencha User
    Join Date
    Jun 2011
    Location
    Russia
    Posts
    34
    Vote Rating
    0
    icemanovich is on a distinguished road

      0  

    Default


    You should pay attention on listener in textarea field like specialKey where you can check for CTRL+Space combinations and show comboBox in current position.

  5. #4
    Sencha User
    Join Date
    May 2010
    Location
    Las Vegas, NV
    Posts
    132
    Answers
    7
    Vote Rating
    2
    billtricarico is on a distinguished road

      0  

    Default


    Well that's for the entire textfield/area. I am just looking for a pop up combobox/triggerfield that I can conjure up as a layer above the textfield/area. Maybe all it is is a "context menu" type of popup that contains a comboboxt/triggerfield? Something like the attached image:


    IntelliSense.jpg

  6. #5
    Sencha User
    Join Date
    May 2010
    Location
    Las Vegas, NV
    Posts
    132
    Answers
    7
    Vote Rating
    2
    billtricarico is on a distinguished road

      0  

    Default


    Yeah iceman. Something like that. I will have to experiment and see what I come up with. I was just wondering if there is some kind of plugin that already exists. I guess not.

  7. #6
    Sencha User
    Join Date
    May 2010
    Location
    Las Vegas, NV
    Posts
    132
    Answers
    7
    Vote Rating
    2
    billtricarico is on a distinguished road

      0  

    Default


    Well I am able to catch the events specialkey and keydown, both of those will tell me if CTRL and SPACE were triggered, respectively. But how can I test them both in the same event? These events are mutually exclusive.

    Since I am using MVC, I don't suppose there is a way to communicate between these events? Is there a way I can declare a variable in this controller so I can set a flag that CTRL is currently pressed?

    Beyond that...the next question is...how do I get the current XY of the cursor so as to pop a combobox there?

    Thanks.

  8. #7
    Sencha User
    Join Date
    Jun 2011
    Location
    Russia
    Posts
    34
    Vote Rating
    0
    icemanovich is on a distinguished road

      0  

    Default


    Try to use keyMap to identify which keys are pressed.
    For locate XY position ... may be getPosition method can help.

  9. #8
    Sencha User
    Join Date
    May 2010
    Location
    Las Vegas, NV
    Posts
    132
    Answers
    7
    Vote Rating
    2
    billtricarico is on a distinguished road

      0  

    Default


    Yes KeyMap looks exactly like what I need.

    However, getPosition() probably won't work. This will give me the XY of the TextArea. I need the XY of the cursor in the TextArea.

    Does anybody have any thoughts?

  10. #9
    Sencha User
    Join Date
    May 2010
    Location
    Las Vegas, NV
    Posts
    132
    Answers
    7
    Vote Rating
    2
    billtricarico is on a distinguished road

      0  

    Default


    So what I have come to realize is that it's not a trivial solution.

    Here is an example:

    http://enobrev.info/cursor/

    This article provides insight into this interesting problem:

    http://stackoverflow.com/questions/128342/display-div-at-cursor-position-in-textarea

  11. #10
    Sencha User lorezyra's Avatar
    Join Date
    Dec 2007
    Location
    Japan -- 日本
    Posts
    531
    Answers
    6
    Vote Rating
    3
    lorezyra will become famous soon enough

      0  

    Default


    This looks quite interesting!

    Are you looking to create an online IDE on combination with ACE ( http://ace.ajax.org/ ) ?
    Perfection as a goal is a nice idea that can point one in a specific direction. However, since "perfection" is an ever changing (evolving?) and moving target, one must admit that perfection can never be obtained...

    When in doubt, check the d4mn source code!

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar