1. #1
    Touch Premium Member
    Join Date
    Dec 2010
    Posts
    145
    Vote Rating
    2
    tomdchi is on a distinguished road

      0  

    Default How to listen to select even in controller

    How to listen to select even in controller


    In SA I have the grid:

    Code:
    Ext.define('MyDesktop.view.client.ClientReturns', {
        extend: 'Ext.grid.Panel',
        alias: 'widget.clientReturns',
    
        height: 250,
        itemId: 'clientReturns',
        width: 632,
        title: 'Client Returns',
        forceFit: true,
        store: 'client.ClientReturnsStore',
    
        initComponent: function() {
            var me = this;
    
            Ext.applyIf(me, {
                columns: [
                    {
                        xtype: 'gridcolumn',
                        hidden: true,
                        dataIndex: 'id',
                        text: 'ID'
                    },
                    {
                        xtype: 'gridcolumn',
                        dataIndex: 'juris_name',
                        text: 'Jurisdiction'
                    },
                    {
                        xtype: 'gridcolumn',
                        dataIndex: 'return_name',
                        text: 'Return Name'
                    },
                    {
                        xtype: 'gridcolumn',
                        dataIndex: 'state',
                        text: 'State'
                    }
                ],
                viewConfig: {
                    itemId: 'clientReturnsGridView'
                },
                dockedItems: [
                    {
                        xtype: 'pagingtoolbar',
                        dock: 'bottom',
                        width: 360,
                        displayInfo: true,
                        store: 'client.ClientReturnsStore',
                        items: [
                            {
                                xtype: 'searchfield',
                                store: 'client.ClientReturnsStore',
                                margins: '0 0 0 5',
                                width: 200
                            }
                        ]
                    }
                ],
                selModel: Ext.create('Ext.selection.RowModel', {
    
                })
            });
    
            me.callParent(arguments);
        }
    
    });
    And the controller:
    Code:
    Ext.define('MyDesktop.controller.client.ClientReturns', {
        extend: 'Ext.app.Controller',
    
        models: [
            'client.ClientReturnsModel'
        ],
        stores: [
            'client.ClientReturnsStore'
        ],
        views: [
            'client.ClientManagement',
            'client.ClientReturns'
        ],
    
        refs: [
            {
                ref: 'clientManagement',
                selector: 'clientManagement'
            },
            {
                ref: 'clientReturns',
                selector: 'clientReturns'
            },
            {
                ref: 'clientReturnsGridView',
                selector: '#clientReturnsGridView'
            }
        ],
    
        onRowModelSelect: function(rowmodel, record, index, eOpts) {
    
        }
    
    });
    onRowModelSelect was converted to an action in SA but the control is missing. Can someone help me spot whats missing here?

  2. #2
    Sencha - Architect Dev Team
    Join Date
    Jan 2009
    Location
    Frederick, Maryland
    Posts
    810
    Vote Rating
    31
    jminnick has a spectacular aura about jminnick has a spectacular aura about

      0  

    Default


    Are you just trying to listen for a select event on a grid row? If so, give your grid an itemId and add the following bit of code to the init function in your controller:

    Code:
    this.control({
        "grid[itemId=clientReturnsGrid]" : {
            select: this.onRowModelSelect
        }
    })
    Jason Minnick
    Sencha Architect Development Team

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi