Hi,

I want a particular value to be pre-selected in the multi-select box and also fire the listener attached with the multi-select for the first time .

Please see the code below:

Code:
            
        var trainStore = new Ext.data.ArrayStore({
            type: 'ajax',
            url:'<URL which returns JSON array>',
            autoLoad:true,
            fields: ['text', 'value']
        });
 var selectTrain = [{
            bodyStyle: 'padding:10px;',
            items:[{
                xtype: 'multiselect',
                title: 'Select Train(s)',
                name: 'selectTrain',
                width: 250,
                height: 200,
                id: 'selectTrain',
                hidden:true,
                store: trainStore,
                displayField:'value',
                valueField:'text',
                ddReorder: true,
                listeners : {
                       click : function(combo){
                               if(this.getValue() == "All") {
                                   var records = trainStore.getRange();
                                   for (var i = 1; i < records.length; i++) {
                                       selectedTrain += records[i].data.text + ",";
                                   }
                                   selectedTrain = selectedTrain.substring(selectedTrain,selectedTrain.length-1);
                              } else {
                                   selectedTrain = this.getValue();
                               }
                            releaseStore.load({params:{relNoId: selectedTrain}});
                        }
                }
            }],
            buttons: [{
                text: 'Go',
                id: 'trainGoButton',
                hidden:true,
                handler: function(){
                        releaseStore.load({params:{relNoId: selectedTrain}});
                        Ext.getCmp('selectRelease').show();
                        this.hide();
                        Ext.getCmp('releaseGoButton').show();
                }
            }]

        }];
Pls advise.

Regards