1. #1
    Sencha User
    Join Date
    May 2010
    Location
    Belgium
    Posts
    216
    Vote Rating
    1
    Answers
    4
    marxan is on a distinguished road

      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,141
    Vote Rating
    32
    Answers
    87
    tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about

      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,334
    Vote Rating
    87
    Answers
    124
    sword-it is just really nice sword-it is just really nice sword-it is just really nice sword-it is just really nice

      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
    Vote Rating
    1
    Answers
    4
    marxan is on a distinguished road

      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 User dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,091
    Vote Rating
    57
    Answers
    25
    dawesi has a spectacular aura about dawesi has a spectacular aura about

      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
    Vote Rating
    1
    Answers
    4
    marxan is on a distinguished road

      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,141
    Vote Rating
    32
    Answers
    87
    tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about tvanzoelen has a spectacular aura about

      0  

    Default

    That the last one in the list

  9. #8
    Sencha User
    Join Date
    May 2010
    Location
    Belgium
    Posts
    216
    Vote Rating
    1
    Answers
    4
    marxan is on a distinguished road

      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.