Results 1 to 4 of 4

Thread: Button in Grid cell

  1. #1
    Sencha User tomalex0's Avatar
    Join Date
    Apr 2009
    Location
    San Jose, CA
    Posts
    589
    Vote Rating
    20
      0  

    Post Button in Grid cell

    Hi i'm showing a grid in window which is fetching value from Db, i have to implement a button in grid coloumn ( header download) ie mentioned below, the grid is list of files that can be downloaded, so how can i render a button in a cell.
    Code:
    this.columnModel = new Ext.grid.ColumnModel([new Ext.grid.RowNumberer(), {
        header: 'ID',
        readOnly: true,
        dataIndex: 'Id',
        width: 60,
        hidden: true
    },
    {
        header: 'Name',
        readOnly: true,
        dataIndex: 'name',
        width: 250,
        hidden: false
    },
    {
        header: 'Download',
        readOnly: true,
        dataIndex: 'details',
        width: 100,
        hidden: false
        //button should go here
    }]);

  2. #2
    Sencha User bt_bruno's Avatar
    Join Date
    Mar 2008
    Location
    Redwood City, CA
    Posts
    154
    Vote Rating
    11
      0  

    Default

    You can put an image and listen to the cellclick event on grid to determine the action.

    Code:
    renderer: function()
    {
        return '<img src="'+Ext.BLANK_IMAGE_URL+'" class="ico_download" />'
    }
    Code:
    cellclick : function( grid, rowIndex, columnIndex, e ) 
    {
        var dataIndex = grid.getColumnModel().getDataIndex();
        
         if( dataIndex === 'details')
         {
             //TODO: download rotine
         }
    }

  3. #3
    Sencha User tomalex0's Avatar
    Join Date
    Apr 2009
    Location
    San Jose, CA
    Posts
    589
    Vote Rating
    20
      0  

    Default working

    thx for the helpful tip from u

  4. #4
    Sencha User tomalex0's Avatar
    Join Date
    Apr 2009
    Location
    San Jose, CA
    Posts
    589
    Vote Rating
    20
      0  

    Post button in grid

    I have found method of rendering button in grid cell , you can find out it in the below mentioned link

    http://extjs.com/forum/showthread.php?p=213769

Posting Permissions

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