[CLOSED] PagingToolbar (pageindex) not updating

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] PagingToolbar (pageindex) not updating

    Hi, I have a GridPanel which contains a Store and a PagingToolbar.
    In this Store I'm setting the OnRefreshData property to a server method but so the PagingToolbar PageIndex is not updating to next value.

    Thank you
    Last edited by Daniil; Mar 26, 2012 at 9:49 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please provide a sample to reproduce.
  3. #3
    <script runat="server">
    protected void store_RefreshData(object sender, StoreRefreshDataEventArgs e)
        {
            this.btnVisualizar.FireEvent("click", new object[] { e.Start.ToString(), e.Limit.ToString() });
        }
    </script>
            <ext:Button ID="btnVisualizar" runat="server" Text="Visualizar">
                <DirectEvents>
                    <Click Url="../../Handler/ExcelLer.ashx" Success="gridExcel.getStore().loadData(result);">
                        <ExtraParams>
                            <ext:Parameter Name="fileuploadval" Mode="Raw" Value="$('#fileUpload').val()" />
                        </ExtraParams>
                    </Click>
                </DirectEvents>
            </ext:Button>
    <ext:GridPanel ID="gridExcel" Layout="FitLayout" runat="server" StripeRows="true"
        TrackMouseOver="true" Title="Excel" Frame="true" Collapsible="true" CollapseMode="Default"
        AnimCollapse="false" Height="300">
        <Store>
            <ext:Store ID="store" runat="server" WarningOnDirty="false" AutoDataBind="true" AutoLoad="false"
                OnRefreshData="Store1_RefreshData">
                <Proxy>
                    <ext:PageProxy>
                    </ext:PageProxy>
                </Proxy>
                <BaseParams>
                    <ext:Parameter Name="FileName" Mode="Raw" Value="$('#fileUpload').val()" />
                    <ext:Parameter Name="Paginacao" Mode="Value" Value="1" />
                </BaseParams>
                <AutoLoadParams>
                    <ext:Parameter Name="start" Value="={0}" />
                    <ext:Parameter Name="limit" Value="={20}" />
                </AutoLoadParams>
                <Reader>
                    <ext:JsonReader Root="Data" TotalProperty="TotalRecords">
                    </ext:JsonReader>
                </Reader>
                <DirectEventConfig IsUpload="true" />
            </ext:Store>
        </Store>
        <SelectionModel>
            <ext:RowSelectionModel ID="rowselectionmodelImportacao" runat="server" />
        </SelectionModel>
        <LoadMask ShowMask="true" />
        <BottomBar>
            <ext:PagingToolbar ID="pagingtoolbarExcel" runat="server" PageSize="20" DisplayInfo="true"
                DisplayMsg="Apresentando registros do Excel {0} - {1} de {2}" EmptyMsg="Sem registros">
                <Items>
                    <ext:Label ID="labelpaginaExcel" runat="server" Text="Por página:" />
                    <ext:ToolbarSpacer ID="toolbarspacerExcel" runat="server" Width="10" />
                    <ext:ComboBox ID="comboboxpaginaExcel" runat="server" Width="80">
                        <Items>
                            <ext:ListItem Text="20" />
                            <ext:ListItem Text="40" />
                            <ext:ListItem Text="60" />
                        </Items>
                        <SelectedItem Value="20" />
                        <Listeners>
                            <Select Handler="#{pagingtoolbarExcel}.pageSize = parseInt(this.getValue()); #{pagingtoolbarExcel}.doLoad();" />
                        </Listeners>
                    </ext:ComboBox>
                </Items>
            </ext:PagingToolbar>
        </BottomBar>
    </ext:GridPanel>
    • My handler "ExcelLer.ashx" returns a JSON object
    • My grid columns and store fields are generated dinamically.


    This example is enough?
  4. #4
    I don't think paging should work in your case when you load a data using the loadData method.

    What about using the HttpProxy instead of PageProxy and get a data directly from a .ashx handler avoiding this strange structure: PageProxy => Button.FireEvent => loadData.
  5. #5
    Also please clarify do you use Ext.NET v1?
  6. #6
    Quote Originally Posted by Daniil View Post
    I don't think paging should work in your case when you load a data using the loadData method.

    What about using the HttpProxy instead of PageProxy and get a data directly from a .ashx handler avoiding this strange structure: PageProxy => Button.FireEvent => loadData.


    Because if I use HttpProxy in my handler the property context.Request.Files.Count will be 0, so I need another way to get the file in FileUploadField when I change the page of my GridPanel.

    Yes, I'm with V1
  7. #7
    Quote Originally Posted by mcfromero View Post
    Yes, I'm with V1
    Please ask any related to Ext.NET v1 technical support questions on the Premium Help 1.x forum.

    Quote Originally Posted by mcfromero View Post
    Because if I use HttpProxy in my handler the property context.Request.Files.Count will be 0, so I need another way to get the file in FileUploadField when I change the page of my GridPanel.
    Is the thread related to this one, right?
    http://forums.ext.net/showthread.php?17847
  8. #8
    Ok Daniil, sorry.

    Yes, it is about the other topic, but as I cannot get the file on changing page I have changed my trying.

    I need get the upload file on the changing page to get on the rows which will be displayed in the GridPanel (i.e. rows between 20 and 40) to improve page performance when the Excel have more than 1000 rows
  9. #9
    I'm afraid I don't understand why you need to upload a file on paging.

    Do you have an Excel file and need to read a data from that file with paging?
  10. #10
    Look..

    I need to show to the user the content (the rows) of a Excel file in the GridPanel. But this Excel can have more than 5000 rows, so if I load the GridPanel Store with this amount of rows the performance will down.

    Therefore I read the excel file and return only the rows that must be displayed in the GridPanel (in "page load" the rows 1 to 20).

    So, I want:
    When the user click to display the next page I would like get this file again the "filter" and return only the rows 21 to 40.

    My problem is that when I click to change the page my handler is called but the file of FileUploadField is not "passed to the handler". Context.handler.files.count = 0.


    • I already have a class that read the stream and convert the data to Json
    • I'm using asp.net MVC


    Thank you by attention
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 1
    Last Post: Jul 26, 2011, 12:56 PM
  2. PagingToolbar.PageIndex doesn't work
    By YuanChien in forum 1.x Help
    Replies: 2
    Last Post: Jul 20, 2011, 7:22 AM
  3. Replies: 2
    Last Post: Sep 29, 2010, 8:51 PM
  4. reset gridpanel pageindex to 0 after new filter
    By javadzarrin in forum 1.x Help
    Replies: 1
    Last Post: Aug 22, 2010, 8:29 AM
  5. Replies: 1
    Last Post: Apr 04, 2009, 8:38 AM

Posting Permissions