[CLOSED] Group Count in Grid Panel along with paging (0.8.3)

  1. #1

    [CLOSED] Group Count in Grid Panel along with paging (0.8.3)

    Hi,

    We have problem with displaying group count in Grid Panel if the data is grouped in a grid panel when paging is enabled.

    We added a group text tpl as follows the grouping view of the grid panel.

    GroupTextTpl='{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Employees" : "Employee"]})'
    We used a paging toolbar with page size 5.

    I am sending the test solution to the support email. Please check.

    Regards,
    Last edited by Daniil; Nov 24, 2010 at 8:49 AM. Reason: Please use [CODE] tags, [CLOSED]
  2. #2
    Hi,

    Please use the following function inside GroupTextTpl
    var getGroupRecordsCount = function (record) {
                var store = record.store,
                    group = record.get(store.groupField),
                    records = store.getAllRange(),
                    count = 0,
                    st,
                    v1,
                    v2;
                    
                Ext.each(records, function(r){
                    st = store.fields.get(store.groupField).sortType;
                    
                    v1 = st(r.get(store.groupField));
                    v2 = st(group);
                    
                    if(v1 == v2){
                        count++;
                    }
                });
                
                return count;
            };
    GroupTextTpl='{text} ({[getGroupRecordsCount(values.rs[0])]} {[values.rs.length > 1 ? "Companies" : "Company"]})'
    Vladimir Shcheglov
    Sr. Developer
  3. #3
    Hi,

    Thank you! It worked. Please mark this as solved.

    Regards,

Similar Threads

  1. Replies: 0
    Last Post: Jan 06, 2011, 10:50 PM
  2. [CLOSED] How to get record count from the grid panel
    By Vasudhaika in forum 1.x Premium Help
    Replies: 4
    Last Post: Jan 04, 2011, 11:09 AM
  3. Header Group in Grid Panel
    By Rakeshkumar.a in forum 1.x Help
    Replies: 1
    Last Post: Dec 21, 2010, 10:59 AM
  4. [CLOSED] group count in grid
    By alexp in forum 1.x Premium Help
    Replies: 2
    Last Post: Mar 31, 2010, 7:26 AM
  5. Grid panel one group select all
    By anilkumar in forum 1.x Help
    Replies: 0
    Last Post: Jun 13, 2009, 5:18 AM

Posting Permissions