PDA

View Full Version : [CLOSED] Razor - SummaryRenderer



OriCoder
Feb 13, 2013, 11:06 PM
Hi

Trying to format a SummaryColumns with a Renderer so...


.Renderer(new Renderer { Fn = "Ext.util.Format.numberRenderer('0,000.00')" })

works for the normal gridpanel rows

So I would have thought that


.SummaryRenderer(new Renderer { Fn => "Ext.util.Format.numberRenderer('0,000.00')"})

would do the same for the summary row but just returns nothing.

Regards

Baidaly
Feb 14, 2013, 12:48 AM
Hello!

Try to use the following:


.SummaryRenderer("Ext.util.Format.numberRenderer('0,000.00')")

OriCoder
Feb 14, 2013, 1:01 AM
yeh that just seam to be blank too

Baidaly
Feb 14, 2013, 1:13 AM
Can you provide sample?

Daniil
Feb 14, 2013, 6:19 AM
Can you provide sample?

+1

Also just to be sure: what Ext.NET version and browser are you testing against?

OriCoder
Feb 14, 2013, 6:10 PM
+1

Also just to be sure: what Ext.NET version and browser are you testing against?

I am using the release version, just wasted 1hr trying 2.1 and trunk from the SVN but they now tell me the this.Direct, X() now longer exist so I guess you guys have changed something and I'll have to go back the through my project and find out what it is.. :( SVN was working a few days ago when I tried.

Anyway ....

this is the column from my view that I am applying the summary too



Html.X().SummaryColumn().Text("TotalGBP")
.Width(100)
.DataIndex("TotalGBP")
.ID("TotalSUM")
.Text("Total GBP")
.DataIndex("TotalGBP")
.Renderer(new Renderer { Fn = "Ext.util.Format.numberRenderer('0,000.00')" })
.SummaryType(SummaryType.Sum)
.SummaryRenderer("Ext.util.Format.numberRenderer('0,000.00')")


.Renderer - Works fine
.SummaryType - Works fine
.SummaryRenderer - Just get a blank value

5628

Baidaly
Feb 15, 2013, 12:38 AM
I've modified example from here: http://mvc.ext.net/#/GridPanel_Plugins/GroupingSummary/
and have changed only one column Rate and it works fine.

However, there were some problems with this example and it's better to use it from trunk.



Html.X().SummaryColumn()
.Width(75)
.Text("Rate")
.DataIndex("Rate")
.SummaryType(SummaryType.Average)
.Renderer(new Renderer { Fn = "Ext.util.Format.numberRenderer('0,000.00')" })
.SummaryRenderer(new Renderer { Fn = "Ext.util.Format.numberRenderer('0,000.00')" })
.Editor(
Html.X().NumberField().AllowBlank(false).MinValue( 0).StyleSpec("text-align:left")
)

OriCoder
Feb 15, 2013, 12:47 AM
i'll give it a try but having issues with the svn trunk it seams to kill all my grids etc and tells me my vertical scroller not in the grid object now. But everything is fine if I use the release.

Any idea's?

Baidaly
Feb 15, 2013, 3:14 AM
i'll give it a try but having issues with the svn trunk it seams to kill all my grids etc and tells me my vertical scroller not in the grid object now. But everything is fine if I use the release.

Any idea's?

Sorry, my bad, forgot that you are using 2.1. Try the following for Ext.NET 2.1:


.SummaryRenderer("return Ext.util.Format.number(value, '0,000.00')")

OriCoder
Feb 15, 2013, 10:46 AM
Sorry, my bad, forgot that you are using 2.1. Try the following for Ext.NET 2.1:


.SummaryRenderer("return Ext.util.Format.number(value, '0,000.00')")
Tried but just returns this. I am using 2.1 from the SVN

5630

Daniil
Feb 15, 2013, 12:16 PM
I took the sources from the SVN 2.1 branch. Changed some SummaryRenderers in the GroupingSummary example to this one.


.SummaryRenderer("return Ext.util.Format.number(value, '0,000.00')")

And it appears to be working fine.

So, please provide your full test case to reproduce the problem.

OriCoder
Feb 15, 2013, 2:17 PM
I took the sources from the SVN 2.1 branch. Changed some SummaryRenderers in the GroupingSummary example to this one.


And it appears to be working fine.

So, please provide your full test case to reproduce the problem.

I'll put togeather somthing over the weekend and see how I get on.