1. #1
    Sencha User
    Join Date
    May 2010
    Posts
    28
    Vote Rating
    0
    sankarbaluz is on a distinguished road

      0  

    Exclamation Unanswered: Cannot apply getRowClass in GridPanel in extjs4

    Unanswered: Cannot apply getRowClass in GridPanel in extjs4


    Hi,
    I am unable to apply "getRowClass" in GridPanel.I am using Extjs4 with IE9.The following are the code that i tried.Plz help me out regarding this.

    Code:
    getRowClass: function(record, index) { 
      
                var c = record.get('hzFlg'); 
       if(this.showPreview)
                if (c =='Y') { 
                    return 'error-row ';
                }
            }
    Code:
    .error-row { background-color:red !important; }

  2. #2
    Ext JS Premium Member
    Join Date
    Aug 2010
    Posts
    18
    Vote Rating
    0
    sferg989 is on a distinguished road

      0  

    Default getRowClass

    getRowClass


    I am having the same problem.

    here is my code

    Code:
    {
    dataIndex : 'task_code',
    align     : 'right',
    text      : 'Task Code',
    hideable  : true,
    sortable  : true,
    hidden    : false,
    viewConfig : 
      {
         getRowClass: function(record, rowIndex, rowParams, store)
         {
                 return "updated_value" + record.get('task_code');
         }
      }
    }
    here is my css

    Code:
    .updated_value
        {
            background-color:yellow;
            color: red;
        }
    Does anyone have any ideas? Thanks

  3. #3
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,588
    Answers
    540
    Vote Rating
    322
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      1  

    Default


    A working example:

    Code:
    .custom .x-grid-cell {
        background-color: yellow;
        color: red;
    }
    Code:
    viewConfig: {
        getRowClass: function() {
            return 'custom';
        }
    }
    The row class is added to the TR element. Direct changes to the text color should work fine but the background-color won't change because the TD sets it to something else. That's why you need to .x-grid-cell.

    You'll need more rules if you want to change the hover and selection background-colors.

  4. #4
    Sencha User
    Join Date
    Nov 2011
    Location
    India
    Posts
    8
    Vote Rating
    1
    ankit_shahin is on a distinguished road

      0  

    Default


    Thanks. Its working for me.

  5. #5
    Sencha User mysticav's Avatar
    Join Date
    Mar 2007
    Location
    Mexico
    Posts
    474
    Answers
    2
    Vote Rating
    5
    mysticav is on a distinguished road

      0  

    Default


    This does not work correctly on 4.2.1, using neptune theme, because once the custom background color is applied, the hover and selection default colors stop working. That is, in this case the yellow background will prevail even if you hover or select the row. I don't know if this is a bug or Neptune requires different approach.
    Using Ext with cachefly
    Working on LAMPExt

  6. #6
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,588
    Answers
    540
    Vote Rating
    322
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    The specificity of the hover and selection rules in Neptune is the same as the specificity in the custom selector (i.e. 2 classes). If you put the custom CSS before the standard ExtJS CSS it should work the way you want.

  7. #7
    Sencha User mysticav's Avatar
    Join Date
    Mar 2007
    Location
    Mexico
    Posts
    474
    Answers
    2
    Vote Rating
    5
    mysticav is on a distinguished road

      0  

    Default


    It worked! Thanks.
    Using Ext with cachefly
    Working on LAMPExt

  8. #8
    Sencha User mysticav's Avatar
    Join Date
    Mar 2007
    Location
    Mexico
    Posts
    474
    Answers
    2
    Vote Rating
    5
    mysticav is on a distinguished road

      0  

    Default


    Question, there is no effect on strippedRows. the grid-row-alt is preventing the custom class to be applied.

    Any idea ?
    Using Ext with cachefly
    Working on LAMPExt

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