Reputation: 11975
In my code:
// Here we get the nodes for each job and select them from the combo box.
var nodesArrayForJobID = this.getNodesForJobID(jobID);
for (var i = 0; i < nodesArrayForJobID.length; i++) {
var node = nodesArrayForJobID[i];
Ext.getCmp(jobID + "combobox_nodes").select(node)
}
It knows to select more than one value (runs through for loop twice), but selecting a new value deselects the old one.
How can I select more than one value at once? I'm looking for either a command that selects multiple nodes (takes in an array), or a command that has a parameter to specifically not deselect existing selected nodes.
Thanks.
Upvotes: 1
Views: 4232
Reputation: 535
You can use the MultiCombo component:
<ext:MultiCombo ID="multiCombo1" SelectionMode="All" runat="server" Mode="Local"
DisplayField="Text" ValueField="Value" StoreID="storeMultiCombo"
EmptyText="Select a value" Editable="false" AllowBlank="false" CausesValidation="true"
meta:resourceKey="multiCombo1" ></MultiCombo>
Upvotes: 0
Reputation: 1951
You could use value:[ArrayOfValues] config or use setValue([ArrayOfValues]) method to select more than one value
Sample fiddle here: https://fiddle.sencha.com/#fiddle/9u8
Upvotes: 2
Reputation: 17743
Did you configure your combo box to allow multi-select?
http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.form.field.ComboBox-cfg-multiSelect
Upvotes: 2