1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    25
    Answers
    6
    Vote Rating
    0
    Mteixeira is on a distinguished road

      0  

    Default Answered: Renderer Action Column

    Answered: Renderer Action Column


    I have this on a grid:

    Code:
    {                xtype: 'actioncolumn',
                    renderer: function (val, metadata, record) {
                        if (record.raw.possibleActions != 2) {
                            this.items[0].icon = '';
                            this.items[0].tooltip = '';
                        }
                        
                        metadata.style = 'cursor: pointer;';
                        return val;
                    },
                    width: 30,
                    align: 'center',
                    sortable: false,
                    items: [{
                        icon: 'images/edit.png',
                        tooltip: 'stuff',
                        handler: function (grid, rowIndex, colIndex) {
                            'do stuff'
                        }
                    }]
                },
    I want that when the field "possibleActions" is different than 2 to hide/remove the action column.
    With this
    Code:
    this.items[0].icon = '';
    it removes the icon from all the columns...

    How can i access the column for the specific row that matches the condition??

  2. I've solved it:


    Code:
    renderer: function (val, metadata, record) {
                        if (record.raw.possibleActions != 2) {
                            this.items[0].icon = '';
                            this.items[0].tooltip = '';
                        } else {
                            this.items[0].icon = 'images/edit.png';
                            this.items[0].tooltip = 'RELATÓRIO FINAL';
                        }
    
    
                        metadata.style = 'cursor: pointer;';
                        return val;
                    },
    It seems that renderer overwrites the initial configuration and that was why all record had no icons.

  3. #2
    Sencha User
    Join Date
    Jul 2012
    Posts
    25
    Answers
    6
    Vote Rating
    0
    Mteixeira is on a distinguished road

      0  

    Default


    I've solved it:


    Code:
    renderer: function (val, metadata, record) {
                        if (record.raw.possibleActions != 2) {
                            this.items[0].icon = '';
                            this.items[0].tooltip = '';
                        } else {
                            this.items[0].icon = 'images/edit.png';
                            this.items[0].tooltip = 'RELATÓRIO FINAL';
                        }
    
    
                        metadata.style = 'cursor: pointer;';
                        return val;
                    },
    It seems that renderer overwrites the initial configuration and that was why all record had no icons.

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar