1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    13
    Vote Rating
    0
    rans is on a distinguished road

      0  

    Default Sort grid by group sum

    Sort grid by group sum


    Hi,

    I can't find an option to sort my grid by the group summaryRenderer, how can I do it?sort group.png

    Code:
    var leaderboardGrid = Ext.create('Ext.ux.LiveSearchGridPanel', {
    			store: 'leaderboardStore',
    			columnLines: true,
    			id: 'leaderboardView',
    			collapsible: false,
    			
    			columns: [
    				{
    					text     : 'User Name',
    					flex     : 2,
    					sortable : true,
    					dataIndex: 'userId',
    
    
    				}, {
    					text     : 'Round',
    					width: 90,
    					sortable : true,	
    					dataIndex: 'cycle',
    					
    				},{
    					text     : 'Points',
    					flex     : 1,
    					sortable : true,	
    					dataIndex: 'point',
    					summaryType: 'sum',
    					summaryRenderer: function(value, summaryData, dataIndex) {
    						return value + ' points';
    					},
    				},
    			],
    			features: [{
    				id: 'group',
    				ftype: 'groupingsummary',
    				
    				groupHeaderTpl: '{name}',
    				
    				hideGroupedHeader: true,
    				
    			}],
    			
    			height: 350,
    			width: 600,
    			title: 'Leaderboard',
    			
    			viewConfig: {
    				stripeRows: true
    			},
    
    
    		});
    thanks,
    Rans

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,203
    Vote Rating
    856
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You are going to have to specify your own sorter to sort with your complex criteria. You could also return the group data in the records and sort by that field
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread