PDA

View Full Version : [FIXED] remoteRoot in summary feature



mario.casola
12 Apr 2013, 5:34 AM
Hi,


I'm working with version 4.2 and I have noticed that remoteRoot config is ignored. This is not the case with the grouping summary feature that works fine.


Best regards
Mario Casola

slemmon
12 Apr 2013, 2:40 PM
In the generateSummaryData method source I'm seeing:



...
if (me.remoteRoot && reader.rawData) {
hasRemote = true;
remoteData = {};
// reset reader root and rebuild extractors to extract summaries data
root = reader.root;
reader.root = me.remoteRoot;
...


Looks like it's being evaluated. Can you elaborate on the issue you're seeing?

mario.casola
13 Apr 2013, 2:44 AM
I've done two test, one with grouping summary feature and one with summary feature. I've used the developer tool of Google Chrome and I've added a breakpoint on the line to which you are referring. With the first feature the line is evaluated and not with the second.
The generateSummaryData method is only called from Ext.grid.feature.Grouping class.

mario.casola
17 Apr 2013, 1:46 AM
Hi,

have you got to check the issue?

thanks
Mario

slemmon
19 Apr 2013, 3:08 PM
Thanks for the report! I have opened a bug in our bug tracker.

Daniil
10 Jul 2013, 6:07 AM
We are also interested in fixing this.

Just a note. There is the following phrase

Used by the Grouping Feature when {@link #showSummaryRow} is `true`.
in the doc comments for the generateSummaryData method. So, it is supposed to be used only with a GroupingSummary feature.

Currently, we are using the following override as a workaround.

Ext.grid.feature.Summary.override({
createSummaryRecord: function(view) {
var columns = view.headerCt.getVisibleGridColumns(),
info = {
records: view.store.getRange()
},
colCount = columns.length, i, column,
summaryRecord = this.summaryRecord || (this.summaryRecord = new view.store.model(null, view.id + '-summary-record'));

// Set the summary field values
summaryRecord.beginEdit();

if (this.remoteRoot) {
if (view.store.proxy.reader.rawData) {
summaryRecord.set(view.store.proxy.reader.rawData.summaryData); // hardcoded "summaryData"
}
} else {
for (i = 0; i < colCount; i++) {
column = columns[i];

// In summary records, if there's no dataIndex, then the value in regular rows must come from a renderer.
// We set the data value in using the column ID.
if (!column.dataIndex) {
column.dataIndex = column.id;
}

summaryRecord.set(column.dataIndex, this.getSummary(view.store, column.summaryType, column.dataIndex, info));
}
}

summaryRecord.endEdit(true);
// It's not dirty
summaryRecord.commit(true);
summaryRecord.isSummary = true;

return summaryRecord;
}
});

slemmon
10 Jul 2013, 3:39 PM
Thanks, @Daniil.
I added your notes to the ticket.

mcouillard
4 Sep 2013, 7:32 AM
We're also using that remoteRoot override to support a remote data summary. Thanks!

undeclared
3 Jun 2014, 11:46 AM
Has this been fixed in Ext JS 5 or Ext JS 4.2.2?

Gary Schlosberg
17 Jun 2014, 8:38 AM
Looks like we haven't had a chance to get to this one yet. I've noted your interest on the ticket to add visibility.