[CLOSED] Store start value is not resetting with Paging Toolbar Refresh Event (Version 0.8.3)

Page 1 of 3 123 LastLast
  1. #1

    [CLOSED] Store start value is not resetting with Paging Toolbar Refresh Event (Version 0.8.3)

    Dear Team,

    I have a grid panel with a paging toolbar with default page size is 10. The data source returning 20 records. So, paging toolbar showing two pages on the screen. During page navigation the data being shown on the grid is quite good. But if I navigate to 2nd page and refresh button is clicked on the paging toolbar, not resetting the view of the grid panel to starting page as paging toolbar page index is setting 1.

    I am sending the test solution to support email.

    Reproduction script:
    1. Run the Default Page.
    2. Grid shows page 1 of 2.
    3. Click on next button. Grid panel populates the second page and shows navigation as 2 of 2.
    4. Now click on refresh button. Navigation shows Page 1 of 2. But grid panel do not populate the page 1 as it remain shows page 2 data.

    Regards,
    Last edited by Daniil; Nov 26, 2010 at 5:59 AM. Reason: [CLOSED]
  2. #2
    Hi,

    I see no new message on our support email. Please re-send to support@object.net
  3. #3
    Hi,

    Sorry I have sent to old support mail address support@object.net

    I have now sent to support@object.net

    We are using
    Visual Studio : 2008 (3.5 Net) version.
    OS: Windows XP SP 3
    Browsers : IE 8, Forefox 3.6.12.

    Please check once again.

    Thank you.
    Last edited by vedagopal2004; Nov 17, 2010 at 10:00 AM. Reason: type errors
  4. #4
    Hi,

    Thank you, now I see. But, unfortunately, I can't run the test project. There is no .csproj file.
  5. #5
    Hi again,

    It was silly of my side, I was able to run this as Web Site.

    Please use the following fix within the <head> of Default.aspx

    Fix
    <ext:ScriptContainer runat="server" />
    <script type="text/javascript">
        Ext.ux.data.PagingStore.override({
            loadData : function (o, append) {
                this.isPaging(Ext.apply({}, this.lastOptions ? this.lastOptions.params : null, this.baseParams));
                var r = this.reader.readRecords(o);
                this.loadRecords(r, Ext.apply({add: append}, this.lastOptions || {}), true);
            }
        });
    </script>
    Last edited by Daniil; Nov 17, 2010 at 5:06 PM.
  6. #6
    Hi,

    Sorry, this fix is not working without my code written in code behind of User Control.
    Please try to comment the lines in "strEmployees_RefreshData" procedure in the EmployeeList.ascx User control. (Please use the previous test solution).

    And one more thing, I didn't give my real time implementation of changing the page size while loading the page based on the last page size saved by User (.net Profiling used).

    I have uploaded testing solution again with 22Nov2010 date. Please check once again.

    Reproduction:

    1. Run the solution
    2. Initially page loads with details as seen in picture.
    Click image for larger version. 

Name:	Image 1.JPG 
Views:	1732 
Size:	14.9 KB 
ID:	1924
    3. Navigate to Page 2 (see picture)
    Click image for larger version. 

Name:	Image 2.JPG 
Views:	1710 
Size:	13.5 KB 
ID:	1925
    4. Now click on refresh button (See picture)
    Click image for larger version. 

Name:	Image 3.JPG 
Views:	1725 
Size:	13.5 KB 
ID:	1926

    From above.
    * Page is not resetting to Page 0, even if it is set in the refresh event handler.
    * This might be because of custom sorting applied in the page loading.. But is not applying during Refresh
    * The sorting is again applied during navigation.

    If you click on next button once and previous button navigation then, the sorting is applied and data is displayed correctly.

    So, I think some more fix need to provide in this issue, as Paging, sorting, grouping and filtering to be reapplied during refresh button click. It is not happening now as I assume, so the problems are.

    Regards
    Last edited by vedagopal2004; Nov 22, 2010 at 8:38 AM. Reason: to provide more details and testing scenario
  7. #7
    Hi,

    I can't see strEmployees_RefreshData in the in the EmployeeList.ascx. I added it myself but, seems, the issue doesn't appear with the fix I mentioned.

    Please clarify did you send to us the full code to reproduce?
  8. #8
    Hi,

    I am sending the test solution along with all the trials done by since the last reply to this thread.

    Once the LoadData overload is completed,

    I tried to call the ApplySort() but the function is sorting the data only when sorting is local. So, I applied a local sorting on the data of the store again. But I lost the grouping.

    So, later I have called the this.applyGrouping() function also from your fix.

    It solved the problem but, still the problem is there if filters are applied on the data. (using filter plug ins)

    I am sure you can give a better workaround after looking at my trials.

    Please note that the "strEmployees_RefreshData" event handler is there in EmployeeList.ascx.cs (Code behind file).

    Thanks in advance.

    Regards,
  9. #9
    Quote Originally Posted by vedagopal2004 View Post
    Hi,

    Please note that the "strEmployees_RefreshData" event handler is there in EmployeeList.ascx.cs (Code behind file).
    Thank you, we got it.

    Quote Originally Posted by vedagopal2004 View Post
    Hi,

    Please note that the "strEmployees_RefreshData" event handler is there in EmployeeList.ascx.cs (Code behind file).
    Now I see a Refresh's handler in the new test solution. Just for the note, here is a full code behind of user control which was in the previous test solution. Never mind. We are investigating the problem.

    User's control code behind (previous test solution)
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using BizHR.UI;
    using Newtonsoft.Json.Linq;
    using Coolite.Ext.Web;
    using ControlTest;
    
    namespace BizHR.UI.UserControls.HR
    {
        public partial class EmployeeList : System.Web.UI.UserControl
        {
            protected override void OnLoad(EventArgs e)
            {
                base.OnLoad(e);
                if (!IsPostBack && !Ext.IsAjaxRequest)
                {
                    //strEmployees.GroupField = "Country";
                    //pgtbrPaging.PageIndex = 0;
                    //pgtbrPaging.PageSize = 10;
                    //strEmployees.AutoLoadParams["limit"] = pgtbrPaging.PageSize.ToString();
                    //strEmployees.SortInfo.Field = "Country";
                    //strEmployees.SortInfo.Direction = Coolite.Ext.Web.SortDirection.DESC;
                    grpvEmployees.EnableRowBody = true;
                    grpvEmployees.EnableViewState = true;
                }
            }
    
            protected void GroupClicked(object sender, AjaxEventArgs e)
            {
                Ext.MessageBox.Alert("Group Message", "GroupId: " + e.ExtraParams["GroupId"] + " - EmployeeId: " + e.ExtraParams["EmployeeId"]).Show();
            }
    
            protected void txtPageSize_TextChanged(object sender, EventArgs e)
            {
                int pageSize = 10;
                if (!string.IsNullOrEmpty(txtPageSize.Text) && int.TryParse(txtPageSize.Text, out pageSize))
                {
                    pgtbrPaging.PageSize = pageSize;
                    pgtbrPaging.PageIndex = 0;
                    strEmployees.AutoLoadParams["limit"] = pgtbrPaging.PageSize.ToString();                
                }
                else
                {
                    //
                }
            }
        }
    }
  10. #10
    Hi,

    As for me, your workaround looks fine.

    To apply filters please try the following thing.

    Example
    gpEmployees.filters.reload();
Page 1 of 3 123 LastLast

Similar Threads

  1. Paging toolbar refresh after filter
    By dan182 in forum 1.x Help
    Replies: 6
    Last Post: Dec 28, 2011, 9:48 AM
  2. [CLOSED] Refresh Event in Paging Toolbar
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Aug 06, 2011, 2:46 PM
  3. Paging Toolbar (hide refresh button)
    By marcmvc in forum 1.x Help
    Replies: 1
    Last Post: Apr 16, 2010, 7:01 PM
  4. Replies: 1
    Last Post: Aug 24, 2009, 1:37 PM
  5. [CLOSED] Paging Toolbar without refresh button?
    By Sharon in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 20, 2009, 10:11 AM

Posting Permissions