1. #1
    Ext JS Premium Member
    Join Date
    Oct 2011
    Posts
    84
    Vote Rating
    0
    Webtel is on a distinguished road

      0  

    Exclamation Answered: how to select all items in combo (multiselect:true)

    Answered: how to select all items in combo (multiselect:true)


    how to select all items in the list of combobox? Im looking for something like combo.selectAll().

    multiSelect : Boolean
    If set to true, allows the combo field to hold more than one value at a time, and allows selecting multiple items from the dropdown list.

    select( Object r )
    Selects an item by a Model, or by a key value.

  2. Something a bit like this:

    Code:
    combo.select(combo.getStore().collect(combo.valueField));
    or this:

    Code:
    combo.setValue(combo.getStore().collect(combo.valueField));

  3. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,603
    Answers
    543
    Vote Rating
    325
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Something a bit like this:

    Code:
    combo.select(combo.getStore().collect(combo.valueField));
    or this:

    Code:
    combo.setValue(combo.getStore().collect(combo.valueField));

  4. #3
    Ext JS Premium Member
    Join Date
    Oct 2011
    Posts
    84
    Vote Rating
    0
    Webtel is on a distinguished road

      0  

    Default ok. so im looking for override to have a clean method in combo class

    ok. so im looking for override to have a clean method in combo class


    So maybe anyone made some extension or override? I wont just put that line of code whernever i need to check all items in combo,. sory.

    besides.. it doesent look good for sencha not to have implemented this yet. It is so obvious functionality that every customer wants to have it...

    PS. Now you dont use combo.getStore() but just combo.store

    PS of course Skirtle's solution works fine. I just d like to have it where i m sure it should be. 5

  5. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,603
    Answers
    543
    Vote Rating
    325
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    So maybe anyone made some extension or override? I wont just put that line of code whernever i need to check all items in combo,. sory.
    If you want to add it as a method to the combobox then just add it, it's only a couple of lines. However I wonder whether there are really enough places in your code where you want to use this to justify adding an extra method.

    besides.. it doesent look good for sencha not to have implemented this yet. It is so obvious functionality that every customer wants to have it...
    Not really. This is the first time I've heard anyone request this. Sencha have to be quite cautious about what methods they add to avoid library bloat. Given this can already be achieved using a one-liner it's unlikely to be a priority. It also poses problems for what the method would do for a combobox that does not have multiselect enabled.

    PS. Now you dont use combo.getStore() but just combo.store
    getStore() is preferred but doesn't exist in 4.0.2. It's there for 4.0.7.

  6. #5
    Sencha User
    Join Date
    Mar 2011
    Posts
    208
    Answers
    2
    Vote Rating
    0
    bee is on a distinguished road

      0  

    Default


    Hi Can I restrict multiselect only for 3 selections ?

  7. #6
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,603
    Answers
    543
    Vote Rating
    325
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    That question is unrelated. Please start your own thread.

Thread Participants: 2

Tags for this Thread