Hybrid View
-
6 Nov 2011 6:59 AM #1
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.
-
Best Answer Posted by skirtle
Something a bit like this:
or this:Code:combo.select(combo.getStore().collect(combo.valueField));
Code:combo.setValue(combo.getStore().collect(combo.valueField));
-
6 Nov 2011 7:37 AM #2
Something a bit like this:
or this:Code:combo.select(combo.getStore().collect(combo.valueField));
Code:combo.setValue(combo.getStore().collect(combo.valueField));
-
6 Nov 2011 11:31 PM #3
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
-
7 Nov 2011 6:32 AM #4
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.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.
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.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...
getStore() is preferred but doesn't exist in 4.0.2. It's there for 4.0.7.PS. Now you dont use combo.getStore() but just combo.store
-
7 Nov 2011 6:34 AM #5
Hi Can I restrict multiselect only for 3 selections ?
-
7 Nov 2011 6:46 AM #6
That question is unrelated. Please start your own thread.


Reply With Quote