Hybrid View

  1. #1
    Sencha User
    Join Date
    Sep 2011
    Location
    Russia
    Posts
    10
    Vote Rating
    1
    azesm is on a distinguished road

      1  

    Default MultiGrouping Grid and Summary

    MultiGrouping Grid and Summary


    Hi

    My code MultiGrouping Grid and Summary ( ExtJs 4.0.7 or higher )

    MultiGrouping
    Снимок экрана 2012-09-15.jpg
    MultiGroupingSummary
    Снимок экрана 2012-09-15.jpg

    mg.zip

    Store:
    ...
    groupers: ['field1', 'field2', 'field3', ...]

    Grid:
    features: [{ ftype: 'multigroupingsummarymy' }]
    or
    features: [{ ftype: 'multigrouping' }]

    P.S. rebuild - http://www.sencha.com/forum/showthread.php?226739-MultiGrouping-and-MultiGroupingSummary
    Thank you - ExTriqui

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,154
    Vote Rating
    475
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Thank you for the contribution.

    Scott.

  3. #3
    Sencha User
    Join Date
    Jun 2011
    Location
    Russia
    Posts
    34
    Vote Rating
    1
    icemanovich is on a distinguished road

      0  

    Default


    guidGenerator() is not defined in this code. Probably this function defined somewhere else.

    Quick fix for this (insert in MultiGrouoping.js):
    Code:
    // Generate unique id for group
        guidGenerator: function(gname){
            var gid = 'x-' + gname + '-' + Ext.id();
            return gid;
        },

  4. #4
    Sencha User
    Join Date
    Sep 2011
    Location
    Russia
    Posts
    10
    Vote Rating
    1
    azesm is on a distinguished road

      0  

    Default


    Hi


    Code guidGenerator()
    Code:
    function guidGenerator() {
        var S4 = function() {
            return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
        };
        return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
    }
    
    



    Code
    trimFIO()
    Code:
    // Removes leading and ending whitespaces
    function trimFIO( value ) {
    
    
        return LTrim(RTrim(value));
        
    }
    
    /// Removes leading whitespacesfunction LTrim( value ) {
        
        var re = /\s*((\S+\s*)*)/;
        return value.replace(re, "$1");
        
    }
    
    
    // Removes ending whitespaces
    function RTrim( value ) {
        
        var re = /((\s*\S+)*)\s*/;
        return value.replace(re, "$1");
        
    }

  5. #5
    Sencha User
    Join Date
    Jun 2011
    Location
    Russia
    Posts
    34
    Vote Rating
    1
    icemanovich is on a distinguished road

      0  

    Default


    Thanks, azesm!
    One more question. There is "group" parameter and it is group.id in MultiGrouping.js
    Code:
    group.id = guidGenerator();
    How can I figure out parent of node on groupcontextmenu event?
    Code:
     
    groupcontextmenu: function(view, node, group, e, eOpts){
    //group - text parens.id
    }
    Example:
    Code:
    mangle:
    FORWARD
    INPUT
    OUTPUT
    When i click to INPUT I need to know parent ("mangle").

  6. #6
    Sencha User
    Join Date
    Sep 2011
    Location
    Russia
    Posts
    10
    Vote Rating
    1
    azesm is on a distinguished road

      0  

    Default


    Hi, icemanovich!

    probably can not answer immediately, you need to experiment
    group.id - I made in order to properly open subgroups, as in the original code, the map was not very nice

  7. #7
    Sencha User
    Join Date
    Oct 2012
    Posts
    6
    Vote Rating
    0
    Garry Hawkins is on a distinguished road

      0  

    Default


    can you please give a sample demo and instruction on how to insert tha zip code in extjs 4.1.1 folder? thanks.

  8. #8
    Ext JS Premium Member canxss's Avatar
    Join Date
    Sep 2008
    Posts
    184
    Vote Rating
    3
    canxss is on a distinguished road

      0  

    Default


    Hi,

    Thanks for this feature. I really need it in my app. But I don't know if you've tried but unfortunately it doesn't work in ext-4.2.beta .

    Then I tried to use it array-grid example in order to find out how was it working so that I could have made it work for 4.2.x. But I get error on this line inside collectData function when I tried to group by a field:


    collapsedState[group.id] = collapsedState[group.id] || collapsedState[child.name];

    Hope that you find the time to update this feature for the new versions of Ext JS.

    Thanks in advance

    Ipek

  9. #9
    Sencha User
    Join Date
    Dec 2012
    Posts
    3
    Vote Rating
    0
    yuva_ess is on a distinguished road

      0  

    Default


    I'm getting this error when I try to use the code
    TypeError: 'undefined' is not an object (evaluating 'child.name')


    =====
    if (group.children) {
    for (gLen = group.children.length - 1; gLen >= 0; gLen--) {
    var child = group.children[gLen];
    child.parent = group.name;
    // child.id = guidGenerator();
    collapsedState[child.name] = collapsedState[group.name] || collapsedState[child.name];
    collapsedState[group.id] = collapsedState[group.id] || collapsedState[child.name];
    if(group.depth == 0) {
    me.nameIDNode[group.id] = group.name;
    gName = group.name;
    } else {
    me.nameIDNode[group.id] = group.parent+group.name;
    }
    groups.splice(g + 1, 0, child);
    }
    me.getGroupRows(group, [], preppedRecords, fullWidth);
    } else {
    group.children = group.records;
    if (group.children.length == 0) {
    me.getGroupRows(group, [], preppedRecords, fullWidth);
    group.collapsibleClass = '';
    } else {
    me.getGroupRows(group, records, preppedRecords, fullWidth);
    }
    me.nameIDNode[group.id] = gName+group.parent+group.name;
    collapsedState[group.id] = collapsedState[group.id] || collapsedState[child.name];

  10. #10
    Sencha Premium Member
    Join Date
    Jan 2013
    Posts
    4
    Vote Rating
    1
    vitorvti is on a distinguished road

      0  

    Default Grouping multiple leves

    Grouping multiple leves


    I also am nedding something like this for ext 4.2