Results 1 to 4 of 4

Thread: How to render row number for grouping grid?

  1. #1
    Ext User
    Join Date
    May 2008
    Posts
    42
    Vote Rating
    0
      0  

    Question 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
    118
      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
      0  

    Default

    It works.
    Appreciate your help condor.

  4. #4
    Sencha User
    Join Date
    Apr 2013
    Posts
    13
    Vote Rating
    0
      0  

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •