1. #1
    Ext User
    Join Date
    May 2008
    Posts
    42
    Vote Rating
    0
    lionhx18 is on a distinguished road

      0  

    Question How to render row number for grouping grid?

    How to render row number for grouping grid?


    Hi All, I meet a problem when render row number for a grouping grid,for example:

    rowNumber column1 column2 column3
    1 A Jim Marry
    2 A Steve Bill

    1 B Sean Allen


    There is a grid which has group field column1 with two different value A and B, My question is how to render rownumber for grouping value respectively.

    Any idea? Thanks in advance.

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    87
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    RowNumberer won't work. You would need to create your own column renderer, e.g.
    Code:
    {header: 'Nr.', width: 23, sortable: false, fixed: true, menuDisabled: true, dataIndex: '', id: 'numberer', renderer : function(value, meta, record, rowIndex, colIndex, store){
    	var num = 0;
    	store.each(function(r){
    		if(r._groupId == record._groupId){
    			num++;
    		}
    		return record != r;
    	});
    	return num;
    }},

  3. #3
    Ext User
    Join Date
    May 2008
    Posts
    42
    Vote Rating
    0
    lionhx18 is on a distinguished road

      0  

    Default


    It works.
    Appreciate your help condor.

  4. #4
    Sencha User
    Join Date
    Apr 2013
    Posts
    13
    Vote Rating
    0
    grief89 is on a distinguished road

      0  

    Default


    Hi!
    Thanks for example, but where are you set field "_groupId"?

Thread Participants: 2