Results 1 to 2 of 2

Thread: Menu with right mouse click and use data from grid

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha Premium Member
    Join Date
    Feb 2012
    Location
    Mlheim an der Ruhr, Germany
    Posts
    82
    Answers
    5

    Question Answered: Menu with right mouse click and use data from grid

    Hello,

    i made a grid from a store and a menu with a right mouse click.

    Now i want to to do a right-click on a row of the grid, the menu opens and the data (for example the id) of the row must be imported in the handler

    Code:
        var artikelGrid = Ext.create('Ext.grid.Panel', {
            store: mystore_massnahmen,
            columns: [                                    {header:"ID",dataIndex:"fuid_massnahme",flex:0,hidden:false},
                                                        {header:"Titel",dataIndex:"titel",flex:1},
                                                        {header:"Beschreibung",dataIndex:"beschreibung",flex:1},
                                                        {header:"Von",dataIndex:"von",flex:1},
                                                        {header:"Bis",dataIndex:"bis",flex:2}                                        
                ],
                listeners : { 
                                        itemcontextmenu : function(record, item, index, e, eOpts){ 
                                                    var xy = eOpts.getXY();                         
                                                    new Ext.menu.Menu({
                                                                items : [{
                                                                            text : 'Ansehen',iconCls: 'employee-lupe'
                                                                }, {
                                                                            text : 'Neuer Datensatz',iconCls: 'employee-add',handler: function() {}
                                                                }, {
                                                                            text : 'Bearbeiten',iconCls: 'employee-edit',handler: function() {
                                                                                 var rec = mystore_massnahmen.getAt(index);
                                                                                
                                                                                 
                                                                                alert("Bearbeiten " + rec.get('fuid_massnahme'));
                                                                               
                                                                            }
                                                                }, {
                                                                            text : 'Eintrag löschen',iconCls: 'employee-remove'
                                                                }, {
                                                                            text : 'Eintrag deaktivieren',iconCls: 'employee-deaktivieren'
                                                                }, {
                                                                            text : 'Eintrag aktivieren',iconCls: 'employee-aktivieren'
                                                                }]
                                                    }).showAt(xy) 
                            }},
            width: 790,
            height: 500,
            title: 'Maßnahmenübersicht',
            frame: true, 
            }
        );
    Really nice, when somebody can help me!

    Greetz
    Sascha

  2. Hi,

    Created a Fiddle for you.

    For more details, Check this link..

    http://www.sencha.com/forum/showthre...w-display-menu


    Thanks,
    Md Naveed
    \m/

  3. #2
    Ext JS Premium Member
    Join Date
    Jul 2011
    Location
    Hyderabad, India
    Posts
    99
    Answers
    15

    Default

    Hi,

    Created a Fiddle for you.

    For more details, Check this link..

    http://www.sencha.com/forum/showthre...w-display-menu


    Thanks,
    Md Naveed
    \m/

Posting Permissions

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