1. #1
    Sencha User
    Join Date
    Jul 2011
    Location
    Moscow
    Posts
    17
    Vote Rating
    0
    _bv_ is on a distinguished road

      0  

    Default Answered: Different row styles in a grid

    Answered: Different row styles in a grid


    Hello everybody,
    How can I make rows in the grid look different depending on some condition? I mean smth like that:
    HTML Code:
    <table>
    <tr class="class1">...</tr>
    <tr class="class2">...</tr>
    </table>

  2. You can set a custom GridViewConfig to your GridView. In that you need to override the getRowStyle method

  3. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,715
    Vote Rating
    107
    Answers
    60
    sven is just really nice sven is just really nice sven is just really nice sven is just really nice

      0  

    Default


    You can set a custom GridViewConfig to your GridView. In that you need to override the getRowStyle method

  4. #3
    Sencha User
    Join Date
    Jul 2011
    Location
    Moscow
    Posts
    17
    Vote Rating
    0
    _bv_ is on a distinguished road

      0  

    Default


    From the documentation:
    getRowStyle
    ( ModelData model, int rowIndex, ListStore<ModelData> ds ) : java.lang.String Returns one to many CSS style names separated by spaces.
    How should I use it? I thought I needed an opposite method, smth like setRowStyle, didn't I?

  5. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,715
    Vote Rating
    107
    Answers
    60
    sven is just really nice sven is just really nice sven is just really nice sven is just really nice

      0  

    Default


    Simple extend GridViewConfig and override that method. In that method you can return the styles you want to display.

  6. #5
    Sencha User
    Join Date
    Jul 2011
    Location
    Moscow
    Posts
    17
    Vote Rating
    0
    _bv_ is on a distinguished road

      0  

    Default


    I've got it. Thank you, Sven.
    Is it possible to make an "hover" pseudo-class or some acronym in the stylesheet then?

Tags for this Thread