Results 1 to 5 of 5

Thread: how click or enter grid extjs row open other windows or alert

  1. #1

    Default how click or enter grid extjs row open other windows or alert

    what this code not work correct

    Code:
    Ext.require([
        '*'
    ]);
    
    
    Ext.onReady(function() {
        
        Ext.define('User', {
            extend: 'Ext.data.Model',
            fields: ['name']
        });
        
        // create the Data Store
        var userStore = Ext.create('Ext.data.Store', {
            model: 'User',
            data: [
                { name: 'ehsan' },
                { name: 'shah' },
                { name: 'Homer' },
                { name: 'Marge'}
            ]
        });  
    
    
    var myGride=Ext.create('Ext.grid.GridPanel', {
        renderTo: Ext.getBody(),
        store: userStore,
        width: 400,
        height: 200,
        title: 'Application Users',
        columns: [
            {
                text: 'Name',
                width: 100,
                sortable: false,
                hideable: false,
                dataIndex: 'name'
            }
        ],
        listeners: {
            rowclick:function(grid, rowIndex, columnIndex, e) {
              alert(rowIndex);
              console.log('Double clicked on ');
            }
        }
    });
    
    
    myGride.on('click', function(){alert(1);}, this, {
            single: true,
            delay: 100,
            forumId: 4
        });
    
    
    var myPanel=Ext.create('Ext.panel.Panel',{
        layout: {
            type: 'vbox',
            align: 'center'
        },
        items: [
            {
            xtype: 'numberfield',
            anchor: '100%',
            name: 'bottles',
            fieldLabel: 'Bottles of Beer',
            value: 99,
            maxValue: 99,
            minValue: 0
        },
            myGride  
        ]
       }
    );
    
    
    myGride.on('rowdblclick', function(grid, rowIndex, e) {
    alert(rowIndex);
    });
    Ext.create('Ext.window.Window',{
        layout: {
            type: 'hbox',
            align: 'center'
        },
        items: [
            myPanel
        ],
        title: 'Hello Window',
        width: 300,
        height: 300,
        id: 'myWindow'
    }).show();
        
    });
    
    not any alert when click or dbl click or

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

    Default

    Have you consulted the docs to see what events on Ext.grid.Panel
    Mitchell Simoens @LikelyMitch

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

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

  3. #3

    Default

    what docs ???

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

    Default

    The API docs that are in the downloaded zip file for the framework or under the Documentation menu at the top of this page.
    Mitchell Simoens @LikelyMitch

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

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

  5. #5

    Default

    It is possible to put an example here

Posting Permissions

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