Results 1 to 4 of 4

Thread: Grids - Action Column to behave like a Flyout Menu

  1. #1
    Sencha Premium Member
    Join Date
    Apr 2012
    Posts
    8
    Vote Rating
    0
      0  

    Default Grids - Action Column to behave like a Flyout Menu

    Hi there,

    I've been looking at using ExtJS for my project and can see that there is a way to embed "actioncolumns" inside of Grid columns. However, my "action" isn't just a single click, it actually needs to show a flyout menu (similar to the Menu control). Is there a direct way to do this in Ext? Or do I have to implement all this functionality myself?

    Thanks!

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,154
    Vote Rating
    249
      1  

    Default

    Something along these lines?

    Code:
    var menu = Ext.widget('menu', {
        items: [{
            text: 'Action 1'
        }, {
            text: 'Action 2'            
        }]
    });
    
    
    Ext.widget('grid', {
        renderTo: Ext.getBody()
        , width: 300
        , height: 300
        , columns: [{
            text: 'Product'
            , dataIndex: 'product'
            , flex: 1        
        }]
        , store: {
            fields: ['product']
            , data: [{
                product: 'Toaster'            
            }]       
        }
        , listeners: {
            itemclick: function (view, record, el, i, e) {
                menu.showAt(e.getXY());
            }
            , itemcontextmenu: function (view, record, el, i, e) {
                e.preventDefault();
                menu.showAt(e.getXY());            
            }        
        }
    });?

  3. #3
    Sencha Premium Member
    Join Date
    Apr 2012
    Posts
    8
    Vote Rating
    0
      0  

    Default

    Brilliant. Exactly what I was after. Much easier than I previously thought it would be

    Thanks!

  4. #4
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,154
    Vote Rating
    249
      0  

    Default

    No problem. Glad I could help.

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
  •