[CLOSED] [Razor] Summary column don't show sum

  1. #1

    [CLOSED] [Razor] Summary column don't show sum

    Hi,

    I try to have simple summary column in grid panel with this code:
    columnModelStavke.Columns.Add(Html.X().SummaryColumn().ID("SummaryColumnIznosStavke").DataIndex("IznosStavke").Text(Resources.R.IznosStavke).Width(120).Align(Alignment.Right)
                                        .Renderer(new Renderer { Fn = "Ext.util.Format.numberRenderer('0,000.00')" })
                                        .HeaderItems(hi => { hi.Add(Html.X().TextField().ID("TextFieldIznosStavke").ReadOnly(true).Cls("text-right")); })
                                        .SummaryType(SummaryType.Sum).SummaryRenderer(summaryRenderer => { summaryRenderer.Handler = "return value;"; })
                                    );
    ...
    .Features(features => {
                                    features.Add(Html.X().Summary().ID("SummaryStavke"));
                                })

    And when user click on button I add new row to grid panel with this function:

        function dodajStavku() {
            var storeSt = Ext.getStore('StoreStavke');
    
            var stavka = {
                guidID: Ext.id(),
                IznosStavke: 123
            };
    
            var pozicija = storeSt.data.length;
            storeSt.insert(pozicija, stavka);
        }
    Adding row to grid works fine but problem is in summary row. Summary row shows only 123 value. Is this a bug or something wrong in this code?
    Last edited by Daniil; Jul 10, 2012 at 3:03 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please call:
    grid.getView().refresh();
    after inserting a new record.
  3. #3
    Thanks, that helps me.

    And can you tell me how can I get sum value from summary column or I need to open new thread?
  4. #4
    I think a new thread is not required.

    To get the summary data please use:
    App.Summary1.summaryData
    It's an object with the columns ids as the properties and respective summary values as the values of these properties.
  5. #5
    Thank, it works. :)

Similar Threads

  1. Grid Panel Summary Column
    By Mina in forum 1.x Help
    Replies: 3
    Last Post: Jan 02, 2012, 9:03 AM
  2. Grid Column Summary Plugin?
    By huzzy143 in forum 1.x Help
    Replies: 10
    Last Post: Aug 10, 2011, 5:19 PM
  3. [CLOSED] summary column for gridpanel?
    By leon_tang in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 25, 2011, 8:01 AM
  4. [CLOSED] Show summary in the grouping
    By Raynald_Fontaine in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 30, 2010, 5:04 PM
  5. Autowrap Grouping Summary Column
    By sachin.munot in forum 1.x Help
    Replies: 1
    Last Post: Nov 23, 2009, 1:04 AM

Tags for this Thread

Posting Permissions