Hybrid View

  1. #1
    Sencha User
    Join Date
    Jul 2012
    Location
    India
    Posts
    87
    Vote Rating
    0
    Ronits is on a distinguished road

      0  

    Default Grid row body column data

    Grid row body column data


    Hi,
    Would like to have some additional information in a row or within a grid. The information might be static or dynamic. Any help?
    Please find the below the image showing an example, how shall it look like.



    The following text is what is needed to be put in the grid : 'Source : Informa WCIS Q1' 2012 ' - The shown component is a grid, with 2 columns.
    Thanks,
    Ronz

  2. #2
    Sencha User existdissolve's Avatar
    Join Date
    Jan 2010
    Location
    Kansas
    Posts
    522
    Vote Rating
    85
    existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice existdissolve is just really nice

      0  

    Default


    Have you tried http://docs.sencha.com/ext-js/4-1/#!...eature.RowBody and http://docs.sencha.com/ext-js/4-1/#!...x.RowExpander?

    If you did, what's it doing that you don't expect, or not doing that you expect it to do?
    I have implemented the rowbody feature successfully for both static and dynamic data (e.g., loading additional content on row expand).

    If you've tried implementing something already, please share whatever code you can and people will help you out. Good luck!

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Location
    India
    Posts
    87
    Vote Rating
    0
    Ronits is on a distinguished road

      0  

    Default


    Hi,
    Yes. I did try implementing the 'RowBody' feature. My bad, should have updated.
    However, the implementation done appends the additional information to each and every row in the grid.
    What is required is to have the additional information, for a particular row only.
    I will update the code asap.
    Thanks,
    Ronz

  4. #4
    Sencha User
    Join Date
    Jul 2012
    Location
    India
    Posts
    87
    Vote Rating
    0
    Ronits is on a distinguished road

      0  

    Default


    Here is the code :
    Code:
            ftype: 'rowbody',       getAdditionalData: function(data, rowIndex, record, orig) {
                var headerCt = this.view.headerCt,
                    colspan = headerCt.getColumnCount();
                return {
                    rowBody: '<div style="padding: 1em">'+'Source : Informa WCIS Q1' 2012+'</div>',
                    rowBodyCls: "my-body-class",
                    rowBodyColspan: colspan
               };
            }
        }
    Hard-coded the text for now. The text - 'Source : Informa WCIS Q1' 2012' comes in all the rows. Need to fix it only for the last row, so that it appears the same as shown in attached image in my previous posts. Please help.
    Thanks,
    Ronz

  5. #5
    Sencha User
    Join Date
    Jul 2012
    Location
    India
    Posts
    87
    Vote Rating
    0
    Ronits is on a distinguished road

      0  

    Default


    Tweaked a bit, and achieved wha I required :
    Code:
    if(record.data.key == 'Performance Segment') {
             rowBodyMod = '<div style="padding-left: 130px;padding-top:5px">'+'Source: Informatics WCIS Q1, 2013'+'</div>';
         }else {
             rowBodyMod = '';
         }
    
         return {
    
             rowBody : rowBodyMod,
    Thanks,
    Ronz

Thread Participants: 1