PDA

View Full Version : Can we sort multi selected value of combo box while selecting values ?



amarprince9
25 May 2017, 10:09 PM
Hiii,

I have a question related to the multi-select selection combo box.

Can we sort the selected value of multi-select combo box while selecting the values?


Ex: suppose I have value A, B, C in the multi-selected combo box.

Current Scenario: If I selected C first then B and then A.
It appears in the box as same order as we selected i.e C,B, A
Desired: it sort automatically while selecting i.e A, B, C

Is that possible? If yes then how can we do that?
Please reply

SurenderBhyan1
4 Jun 2017, 8:55 PM
You can sort value on change listener and set it back.



listeners: {
change: function(combo, newValue, oldValue){
this.setValue(newValue.sort());
}
}



Try in below fiddle.

20ss

amarprince9
15 Jun 2017, 3:15 AM
it Works only for version 4 not for 6.0.2.

SurenderBhyan1
20 Jun 2017, 4:19 AM
Issue seems setValue in change event is causing change event fire endlessly and causing maximum call stack error. issue is with version 5.1.0+

Ticket opened:

https://www.sencha.com/forum/showthread.php?348478-combobox-s-setValue-fires-change-event-endlessly-and-causing-maximum-call-stack-error&p=1190001#post1190001