Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Allowing user to remove the selected item in the combobox

  1. #1
    Sencha Premium User
    Join Date
    Mar 2009
    Posts
    254

    Default Allowing user to remove the selected item in the combobox

    I have a combobox with allowBlank=true, editable=true.

    Now, if this combobox has an item selected, and the user tries to clear the selected item by selecting all text, pressing delete and then navigating to another control by mouse or through tab, combobox restores its previously selected value.

    How can I allow the user to clear the combobox, and leave it blank, when an item is already selected??

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    There is an extension to the twin trigger field in the forums (use the google search), which allows you to implement a combo with a 'clear' button.

  3. #3
    Sencha Premium User
    Join Date
    Mar 2009
    Posts
    254

    Default

    Hi jgarcia, I dont think this should require any extension. I was expecting something out-of the box, as this should be a common issue for many people.

    As a workaround, I have already added an additional trigger to the combobox, which when clicked clears the combo as:
    this.setValue('');

  4. #4
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    Yes, but it does not.

    A cleaner solution would be to create a reusable component, tucked away in your reusable area namespace. But what ever

  5. #5
    Sencha Premium User
    Join Date
    Mar 2009
    Posts
    254

  6. #6
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    pretty much - yes.

    When developing Ext JS applications, I always strive for reusability, which is what I'm writing about in my book (see my sig).


    http://extjsinaction.com/70/final-ap...rs-to-commence

  7. #7
    Sencha Premium User
    Join Date
    Mar 2009
    Posts
    254

    Default

    Hi jgarcia, I also strive for re-usability as much as I can. Having said that, my first concern here was to get the code working. Even setValue('') failed, and combo restored its value on blur. Eventually, clearValue() settled it all.

    Regarding your book,
    Be rest assured, I have read that other (11+ page) long thread, where you are discussing your book.

  8. #8
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    Part of the reason I am marketing the book is not because I make lots of money on it. It's because it spreads knowledge, which is why I agreed to write it. I was approached by Manning because other proposals failed. At the time (May 2008), I had over 7000 posts on this forum, most of which is providing free help to developers like yourself.

    It is for this reason why I have 10 screencasts (with more on the way this year) that span more than 35 minutes in some cases. I also write blog articles for Ext JS (just one thus far, but a few more in the works) and articles for JSMag - all to help people learn the framework.

    So, if my post above (and others) come across like a general marketing ploy, I am sorry. My goal is just to help people learn the framework.


  9. #9
    Sencha Premium User
    Join Date
    Mar 2009
    Posts
    254

    Default

    That was just said in a light mood jgarcia. I really appreciate people like you, Animal and others providing support for free. I never made that remark with money in mind.

    I extend my apologies for that remark and I am editing the post to remove it. I again feel sorry if I offended you even remotely.

  10. #10
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    no offense taken dude. Others have made similar remarks and I think it's good to justify my actions. Please don't remove that post.

Page 1 of 2 12 LastLast

Posting Permissions

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