Upgrade to ExtJS 4.0.2 - Released 06/09/2011
[extjs.git] / src / util / Grouper.js
1 /*
2
3 This file is part of Ext JS 4
4
5 Copyright (c) 2011 Sencha Inc
6
7 Contact:  http://www.sencha.com/contact
8
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file.  Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
11
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
13
14 */
15 /**
16  * @class Ext.util.Grouper
17  * @extends Ext.util.Sorter
18
19 Represents a single grouper that can be applied to a Store. The grouper works
20 in the same fashion as the {@link Ext.util.Sorter}.
21
22  * @markdown
23  */
24  
25 Ext.define('Ext.util.Grouper', {
26
27     /* Begin Definitions */
28
29     extend: 'Ext.util.Sorter',
30
31     /* End Definitions */
32
33     /**
34      * Returns the value for grouping to be used.
35      * @param {Ext.data.Model} instance The Model instance
36      * @return {String} The group string for this model
37      */
38     getGroupString: function(instance) {
39         return instance.get(this.property);
40     }
41 });