[CLOSED] GridPanel with Proxy and Summary

Page 1 of 3 123 LastLast
  1. #1

    [CLOSED] GridPanel with Proxy and Summary

    Greetings. Whether I don't know you can help me. I have GridPanel with Proxy:
    <ext:GridPanel ID="GridPanelMain" runat="server" SelectionMemory="Enabled">
                                <Store>
                                    <ext:Store ID="StoreMain" runat="server" RemoteSort="true">
                                        <Proxy>
                                            <ext:HttpProxy Method="GET" Url="~/SharedData/DicListExtHandler.ashx" />
                                        </Proxy>
                                        <AutoLoadParams>
                                            <ext:Parameter Name="start" Value="0" Mode="Raw" />
                                            <ext:Parameter Name="limit" Value="50" Mode="Raw" />
                                            <ext:Parameter Name="sort" Value="" />
                                            <ext:Parameter Name="dir" Value="" />
                                        </AutoLoadParams>
                                        <SortInfo Field="Id" Direction="DESC" />
                                    </ext:Store>
                                </Store>
                                <BottomBar>
                                    <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="50">
                                        <Plugins>
                                            <ext:SlidingPager />
                                        </Plugins>
                                        <Items>
                                            <ext:ToolbarSeparator runat="server" />
                                             <ext:Label runat="server" Text="Summary Cost:" />
                                            <ext:TextField runat="server" Width="80" Text="$????" ReadOnly="true" />
    
                                            <ext:ToolbarSeparator runat="server" />
                                            <ext:Label runat="server" Text="Avg Cost:" />
                                            <ext:TextField runat="server" Width="80" Text="$????" ReadOnly="true" />
                                        </Items>
                                    </ext:PagingToolbar>
                                </BottomBar>
                           </ext:GridPanel>
    Only in "~/SharedData/DicListExtHandler.ashx" i have access to the data to count the sums. I understand that this data could be sent through Proxy:

    context.Response.Write(JSON.Serialize(new Paging<object>(rangeData, data.Count)));
    But in what format and as them to receive in GridPanel the summary data I do not know ((

    Thanks.
    Last edited by Daniil; Sep 19, 2011 at 6:23 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Store doesn't read any custom information from response

    You have to make separate ajax request to the server (for example, to http handler) using ajax request (for example, Ext.Ajax or pure XmlHttpRequest), return required information, parse and handle response on the client side
  3. #3
    ???

    <ext:Store ID="ProxyStore" runat="server">
                                        <Proxy>
                                            <ext:HttpProxy Method="POST" Url="~/SharedData/DicListExtHandler.ashx" />
                                        </Proxy>
                                        <AutoLoadParams>
                                            <ext:Parameter Name="start" Value="0" Mode="Raw" />
                                            <ext:Parameter Name="limit" Value="50" Mode="Raw" />
                                            <ext:Parameter Name="sort" Value="" />
                                            <ext:Parameter Name="dir" Value="" />
                                        </AutoLoadParams>
                                        <SortInfo Field="Id" Direction="DESC" />
    </ext:Store>
    
    <ext:GridPanel ID="GridPanelMain" runat="server" SelectionMemory="Enabled">
                                <Store>
                                    <ext:Store ID="StoreMain" runat="server" DataSource="#{ProxyStore}.data[Store]" RemoteSort="true">
                                    </ext:Store>
                                </Store>
                                <BottomBar>
                                    <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="50">
                                        <Plugins>
                                            <ext:SlidingPager />
                                        </Plugins>
                                        <Items>
                                            <ext:ToolbarSeparator runat="server" />
                                             <ext:Label runat="server" Text="Summary Cost:" />
                                            <ext:TextField runat="server" Width="80" Text="#{ProxyStore}.data[Summary][0]" ReadOnly="true" />
     
                                            <ext:ToolbarSeparator runat="server" />
                                            <ext:Label runat="server" Text="Avg Cost:" />
                                            <ext:TextField runat="server" Width="80" Text="#{ProxyStore}.data[Summary][1]" ReadOnly="true" />
                                        </Items>
                                    </ext:PagingToolbar>
                                </BottomBar>
    </ext:GridPanel>
  4. #4
    Sorry, I did not understand your last post
  5. #5
    Or to send the data in the additional row??
  6. #6
    Yes, you can it as additional (last) row
    <Load Handler="TextField1.setValue(records[records.length-1].get('fieldname'));" Delay="10"/>
  7. #7
    OK. I have:
    <Listeners>
                                            <Load Handler="???" Delay="10" />
                                        </Listeners>
    <View>
                                    <ext:GridView runat="server" StandardHeaderRow="true">
                                        <HeaderRows>
                                            <ext:HeaderRow>
                                                
                                            </ext:HeaderRow>
                                        </HeaderRows>
                                    </ext:GridView>
                                </View>
    How i can get the FooterRow, and recive data from the Store where my row have column "id" always and in summary row "id" == -1?
    And how i can remove the Summary Row from the GridPanel visibility rows?
  8. #8
    1. Please note that Load is Store listener
    2. What is FooterRow?
    3. To delete additional row
    <Load Handler="TextField1.setValue(records[records.length-1].get('fieldname')); this.remove(records[records.length-1]);" Delay="10"/>
  9. #9
    Quote Originally Posted by Vladimir View Post
    1. Please note that Load is Store listener
    2. What is FooterRow?
    3. To delete additional row
    <Load Handler="TextField1.setValue(records[records.length-1].get('fieldname')); this.remove(records[records.length-1]);" Delay="10"/>
    FooterRow is this HeaderRow which is allocated bottom.
  10. #10
    Does your HeaderRow contain fields? If yes then you can get fields by id.
    I am not sure why do you need to get HeaderRow, what are you try to do with HeaderRow?
Page 1 of 3 123 LastLast

Similar Threads

  1. Summary Row in GridPanel?
    By jsemple in forum 1.x Help
    Replies: 1
    Last Post: Mar 17, 2012, 3:36 PM
  2. [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
  3. [CLOSED] Freezes summary row for gridpanel
    By yobnet in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Sep 15, 2010, 6:24 PM
  4. [CLOSED] Summary Row in GridPanel
    By egodoy in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 05, 2010, 4:49 AM
  5. How to add a summary row in GridPanel?
    By whs2893 in forum 1.x Help
    Replies: 2
    Last Post: Sep 22, 2009, 2:58 AM

Tags for this Thread

Posting Permissions