PDA

View Full Version : [CLOSED] SummaryColumn.SummaryRenderer no longer works in the v2.2 trunk



gets_gui
Jan 15, 2013, 3:56 PM
Hi,

Thanks for a quick fix on the setRootNode problem!

However, when we try it it shows that there is another bug that surfaces. The SummaryColumn.SummaryRenderer breaks which is not the case in the v2.1.1 branch.

Can we suggest to apply the fix to the v2.1.1 branch as well?

It is a showstopper for us right now.

Thanks.
Danny

Vladimir
Jan 15, 2013, 4:30 PM
I tested GroupingSummary and Summary features with trunk version and SummaryRenderer works fine for me
Can you provide test case?

gets_gui
Jan 15, 2013, 4:54 PM
I tested GroupingSummary and Summary features with trunk version and SummaryRenderer works fine for me
Can you provide test case?

It is Html.X().SummaryColumn().SummaryRenderer(r->r.Fn="colorChange") which return undefined not the GroupingSummary and Summary features .
Can you please check?
It works in 2.1.1 pro, we just replaced the dlls built from trunk.

Thanks,

Vladimir
Jan 15, 2013, 5:50 PM
Sorry, I don't understand you.
Do you mean that if summary renderer returns undefined value than summary feature is broken?

Please provide test sample reproduces the issue

gets_gui
Jan 15, 2013, 6:04 PM
Yes, the bug is in summary renderer and it seems like it didn't reconginze the javascript function and return "undefined".
It is diffcult for us to provide the sample code, do you have any examples which using summary renderer?

Vladimir
Jan 15, 2013, 6:25 PM
I tested with official samples (just locally with version from trunk)
http://examples2.ext.net/#/GridPanel/Plugins/Summary/
http://examples2.ext.net/#/GridPanel/Plugins/GroupingSummary/

gets_gui
Jan 16, 2013, 1:29 PM
Did you test for the MVC version?
We have the problem for MVC version and here is the code snippet as I posted yesterday
Html.X().SummaryColumn().SummaryRenderer(r->r.Fn="colorChange")

The colorChange is a javascript function.
And the GUI shows "undefined" in the summary column.

Is it possible put the fix in 2.1.1 as well and let us know the branch (I guess it is 2.1)?

Thanks,

Vladimir
Jan 16, 2013, 1:34 PM
Please provide runable test case

gets_gui
Jan 16, 2013, 1:43 PM
It may take a long time to extract a sample code.
Can you apply the change in 2.1.1?

Vladimir
Jan 16, 2013, 2:04 PM
What change do you mean?

gets_gui
Jan 16, 2013, 2:24 PM
This is the one.
http://forums.ext.net/showthread.php?22984-Grouping-Summary

Daniil
Jan 16, 2013, 3:29 PM
Well, it would be better to continue that thread. I will try to provide you with a workaround.

If you will be able to provide us with a sample to reproduce the problem with SummaryRenderer, it would be a big help for us.

gets_gui
Jan 16, 2013, 5:10 PM
Thanks, Danil.
I actually figure out the problem which caused the problem.
The javascript function we were calling has following signature:
colorChange(value, summaryData, field)
The summaryData and field were different if you try it in 2.1 vs trunk.
For example, field is the filed name (string type) in 2.1 but it is some kind of object in the trunk.

Hope this can help you to figure out the bug...

Daniil
Jan 17, 2013, 5:27 AM
Well, it is not a bug, just a breaking change. Thank you for this information!

We added a new item to BREAKING_CHANGES.txt.


2. The SummaryRenderer signature has been changed. Now it is like a common Column Renderer.

Example

//Old

var oldRenderer = function (value, summaryData, field) {
/* some logic */
return value;
};


<SummaryRenderer Fn="oldRenderer" />

//New

var newRenderer = function (value, metadata, record, rowIndex, colIndex, store, view) {
var summaryData = record.data, // record contains summary data
field = metadata.column.dataIndex;

/* some logic */
return value;
};

<SummaryRenderer Fn="newRenderer" />


Notice that "rowIndex" will be always -1 for SummaryRenderer.