Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    29
    Vote Rating
    0
    dadofgage is on a distinguished road

      0  

    Default how do I hide a value within a grid using a conditional statement?

    how do I hide a value within a grid using a conditional statement?


    I have a column within my grid that I want to hide depending on the value that is being displayed.

    For example, if a count > 0, then hide the column (which is a delete icon that allows that data to be removed).

    I have tried a couple of different variations on using - hidden: true - but I'm not sure where or how to place a conditional statement.

    Code:
    {
      xtype: 'actioncolumn',
      width: 40,
        items: [{
            icon: 'images/delete.png',
            handler: function(grid, rowIndex, colindex) {
                var record = grid.getStore().getAt(rowIndex);
                var id = record.get("ProjectID");
                Ext.Msg.confirm('Confirm Action', 'Are You Sure You Want to Delete?', function(btn) {
                    if(btn == 'yes'){
                        window.location = '<% $base %>delete/' + id;    
                    }
                });
            }
        }]
     }

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    Hi! you may use renderer, see this sample:-

    Code:
    columns: [   
                 {
                        header: 'Sample Number'
                        , dataIndex: 'sample_number'
                        , renderer:YourGrid.sampleNumberRenderer
                    },
                    {
                        header: 'Sample 2'
                        , dataIndex: 'sample_2
                    }
    ]

    Code:
    function sampleNumberRenderer: (value, metadata, record) {
            if(value>2){
              return value;
            }
            else{
               return '';
            }
      }
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

Thread Participants: 1

Tags for this Thread