-
-
Save ideesimple/1014179 to your computer and use it in GitHub Desktop.
Combobox linké
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var firstCombo = new Ext.form.ComboBox({ | |
store: store_combo_1, | |
typeAhead: true, | |
forceSelection: true, | |
triggerAction: 'all', | |
emptyText:'Select a state...', | |
selectOnFocus:true, | |
id:'combo1' | |
}); | |
var secondCombo = new Ext.form.ComboBox({ | |
store: store_combo_2, | |
typeAhead: true, | |
forceSelection: true, | |
triggerAction: 'all', | |
emptyText:'Select a state...', | |
selectOnFocus:true, | |
//Disabled par défaut, si aucune valeur n'est selectionné dans la premiere combo, la seconde n'est pas accessible | |
disabled:true, | |
id:'combo2' | |
}); | |
//On initilaise la premiere combobox | |
firstCombo.store.load(); | |
firstCombo.on('select', function(){ | |
//Je recupere la valeur du combo 1 lors de la selection | |
val = this.getValue(); | |
//je load le store de la seconde combo avec la valeur de la premiere | |
secondCombo.store.load({params:{my_value: val}}); | |
//Je l'a rend accessible | |
secondCombo.enable(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment