1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    2
    Vote Rating
    0
    druckreich is on a distinguished road

      0  

    Default Associated Data in Grid

    Associated Data in Grid


    Hello Forum,

    I am in need of an aha-moment.

    Given the following scenario:

    I want to show items in a grid that belong to a group.
    (item belongsTo group)
    (group hasMany items)
    I want to show the group label instead of the group_id.

    My background is Flex and usually when I wanted to show this kind of scenario I would wait for the items and the groups to be loaded and then find the right group for every item and show it's label.

    Do I use the same aproach in ExtJs?

    thanks

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,080
    Vote Rating
    467
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Have you looked at our grouping grid:
    http://dev.sencha.com/deploy/ext-4.0...groupgrid.html

    You can use the template to change the group label.
    Code:
       var groupingFeature = Ext.create('Ext.grid.feature.Grouping',{
            groupHeaderTpl: 'Cuisine: {name} ({rows.length} Item{[values.rows.length > 1 ? "s" : ""]})'
        });
    Scott.

Thread Participants: 1