Results 1 to 2 of 2

Thread: MultiSelect event in controller not trigger

  1. #1
    Sencha User
    Join Date
    Jan 2014
    Posts
    1

    Default MultiSelect event in controller not trigger

    Hi, I'm trying to trigger the event change in my MultiSelect, I use:

    the controller is:

    Code:
    Ext.define('tierras.controller.ControlDibujar', {
        extend: 'Ext.app.Controller',
        views : ['ViewDibujar'],
        init: function(){
            this.control({
                'viewDibujar multiselect(action=seleccionCapa)': {  
                     change: this.seleccionCapa
                },
        });      
        },
        seleccionCapa: function(element, newValue, oldValue, eOpts ){
            console.log("Hello world!");
        }
    });
    and the view is:

    Code:
    Ext.define('tierras.view.ViewDibujar', {
        extend: 'Ext.window.Window',
        alias: 'widget.viewDibujar',
        id: 'viewDibujar',
        initComponent: function(){
            var capasSeleccionadas = Ext.create('Ext.ux.form.MultiSelect',{
                queryMode:'local',
                id:'Dibujar_capasSeleccionadas',
                store: Ext.create('Ext.data.Store', {
                    fields: ['valor', 'presentacion'],
                    data : [],
                    autoLoad: true
                }),
                displayField: 'presentacion',
                valueField:'valor',
                action: 'seleccionCapa',
            });
            Ext.apply(this, {
                xtype: 'form',
                items:[capasSeleccionadas],
            });
            this.callParent(arguments);
        }    
    });
    The idea is when the user select a value and the control calls the function: "seleccionCapa", but the event never trigger, is there another event to do this?. a second question, I've read the documentation of Ext4.1 for multiselect, but I can't find a configuration property to force the component to keep always 1 item selected, is it posible?

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    It's working for me:

    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •