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

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi