0

i have a problem. i don't understand how group an array multidimensional for two o more values and then sum the field. i just tried with underscore.js but it allows only grouped by value. i'm use extjs 4. i have a grid and i wnat group record for the grid

    var records = Etx.getCmp('grdCorpoFatturaVendita').store.getRange();
    var castellettoDataArray = [];
    for (var x = 0; x < records.length; x++) {
        console.log(records[x]);
        castellettoDataArray.push(records[x].data);
    }

var groupedData = _.groupByMulti(castellettoDataArray, 'CodiceContoContabile');
console.log(groupedData );

1 Answer 1

1

I don't understand you very well, but i think that you are trying to group on a grid for one field:

sencha api: grid grouping

You need to add one feature on your grid view definition:

features: [{
    id: 'group',
    ftype: 'groupingsummary',
    groupHeaderTpl: '{name} ({rows.length})', //print the number of items in the group
    hideGroupedHeader: false
}],

One example on Sencha Api: Example

4
  • hi thank fo you response, but its possible hie headere the group?
    – Brux88
    Commented Jun 6, 2013 at 16:27
  • I don't undestand this text: "hie headere the group". Could did you rewrite it, please?
    – mfruizs
    Commented Jun 7, 2013 at 7:48
  • sorry hi write with my cell ;) , hide header the group
    – Brux88
    Commented Jun 7, 2013 at 8:05
  • You can replace "{name} ({rows.length})" value of "groupHeaderTpl" on blank value like this = groupHeaderTpl : ' '... its the only want that u can do, I maybe with cls templates, but dont know. (another examples) try.sencha.com/extjs/4.1.1/docs/Ext.grid.feature.Grouping.1/… // artsoftsolutions.ro/en/tipsatricks/extjs/…
    – mfruizs
    Commented Jun 7, 2013 at 8:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.