Results 1 to 8 of 8

Thread: Unset a value in multiselect combo

  1. #1
    Sencha User
    Join Date
    May 2010
    Location
    Belgium
    Posts
    216
    Answers
    4
    Vote Rating
    1
      0  

    Default Answered: Unset a value in multiselect combo

    Hello,

    Is there a method to unselect a specific value of a multiselect combo.

    In other words, I have a default value selected and when the user select another value, the default value should be unselected.

    Thanks.

  2. What does getValue() returns an array? Then pop the default value out of that array and set the array again with setValue()

    Code:
    var values = combo.getValue();
    //some code here to pop the unwanted values out
    
    combo.setValue(values)

  3. #2
    Ext JS Premium Member tvanzoelen's Avatar
    Join Date
    Apr 2008
    Location
    Groningen - Netherlands
    Posts
    1,147
    Answers
    87
    Vote Rating
    34
      0  

    Default

    What does getValue() returns an array? Then pop the default value out of that array and set the array again with setValue()

    Code:
    var values = combo.getValue();
    //some code here to pop the unwanted values out
    
    combo.setValue(values)

  4. #3
    Sencha User sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,335
    Answers
    124
    Vote Rating
    91
      0  

    Default

    HI!

    you may use clearValue() for your combo to clear default value.

    Code:
    yourCombo.clearValue();
    check this for detailed information:-
    http://docs.sencha.com/ext-js/4-1/#!...hod-clearValue
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  5. #4
    Sencha User
    Join Date
    May 2010
    Location
    Belgium
    Posts
    216
    Answers
    4
    Vote Rating
    1
      0  

    Default

    The problem with getValue is that I get all the values selected in the combo however I only need the value that has been clicked.

    Is there a method to do that, can't find it in the API.

    Thanks

  6. #5
    Sencha Premium Member dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,093
    Answers
    25
    Vote Rating
    56
      0  

    Default

    put multiSelect:false in your config
    Lead Trainer / Sencha Specialist
    Community And Learning Systems

    Lead Architect
    DigitalTickets.net

  7. #6
    Sencha User
    Join Date
    May 2010
    Location
    Belgium
    Posts
    216
    Answers
    4
    Vote Rating
    1
      0  

    Default

    but I need the multiselect: true.

    What I want is to get the value that has been clicked and not all the value selected in the combo.

  8. #7
    Ext JS Premium Member tvanzoelen's Avatar
    Join Date
    Apr 2008
    Location
    Groningen - Netherlands
    Posts
    1,147
    Answers
    87
    Vote Rating
    34
      0  

    Default

    That the last one in the list

  9. #8
    Sencha User
    Join Date
    May 2010
    Location
    Belgium
    Posts
    216
    Answers
    4
    Vote Rating
    1
      0  

    Default

    Still a problem if I use the last value in the list. I also have to deselect a value. So it won't be in the list anymore and I don't know which value I have deselect.

Posting Permissions

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