1. #1
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    15
    Vote Rating
    2
    Fonnit is on a distinguished road

      0  

    Default Unanswered: icon shows in the Grid

    Unanswered: icon shows in the Grid


    Hi all,

    I want to know whether it is possible to add a icon/text into the first cell that the row number is displayed
    when i add or edit the row. The grid likes the one below.
    #1.png

    Thanks...

  2. #2
    Sencha User
    Join Date
    May 2011
    Location
    Ukraine, Rivne
    Posts
    250
    Vote Rating
    42
    Answers
    44
    redraid has a spectacular aura about redraid has a spectacular aura about redraid has a spectacular aura about

      0  

    Default


    Try this
    Code:
    {
                    text: "&#160",
                    width: 40,
                    sortable: false,
                    draggable: false,
                    autoLock: true,
                    lockable: false,
                    align: 'right',
                    resizable: false,
                    hideable: false,
                    menuDisabled: true,
                    dataIndex: '',
                    cls: Ext.baseCSSPrefix + 'row-numberer',
                    rowspan: undefined,
                    renderer: function(value, metaData, record, rowIdx, colIdx, store) {
                        var rowspan = this.rowspan,
                            showIcon = record.phantom || record.dirty,
                            icon;
    
                        if (rowspan){
                            metaData.tdAttr = 'rowspan="' + rowspan + '"';
                        }
    
                        metaData.tdCls = Ext.baseCSSPrefix + 'grid-cell-special';
    
                        if (showIcon) {
                            icon = record.phantom ? 'new.png' : 'edit.png';
                            return '<img src="' + icon + '" alt="' + icon + '">&nbsp;' + (store.indexOfTotal(record) + 1);
                        }
    
                        return store.indexOfTotal(record) + 1;
                    }
                },

Thread Participants: 1