1. #271
    Sencha User
    Join Date
    Jul 2012
    Posts
    3
    Vote Rating
    0
    northmh is on a distinguished road

      0  

    Default Adding 'exception' event handler to PagingJsonStore is broken

    Adding 'exception' event handler to PagingJsonStore is broken


    Hi, Condor. Thanks for providing this component -- I was a little floored when I realized Ext didn't provide (pre-4) client-side paging out of the box.

    I'm using PagingStore v0.5 with ExtJS 3.3.2 (that version is supplied with the product we're using).

    I have an issue with handling of DataProxy 'exception' events. Previously, when using JsonStore, I assigned an event handler to 'exception' events which just pulls the error message out of the server-side response and displays it in an Ext.MessageBox.alert(...).

    Dropping PagingJsonStore into place breaks that functionality. I've confirmed this by reverting back to JsonStore and it works fine.

    The issue is that it is actually executing my exception handler, but then some later code -- not mine -- is closing the dialog box before it is even visible (I know it isn't mine because I don't have any code anywhere that explicitly closes the box). I can see this by slowing down the execution using FireBug to step through the code. In that case, the dialog box opens, and stays open until I 'continue' the execution. It's as if there is some other exception handling being added after mine.

    I haven't debugged it more deeply than that. Obviously I could step through the code further and eventually find the root cause... which I'll do if I have to, but was hoping you might have a ready insight that could save me the time. Also wanted to alert you to this 'bug' (in that it clearly violates the 'drop-in replacement for *Store' claim).

    Here's a very abbreviated code segment. I'll send more detail if needed:
    Code:
         var storeConfigObj = {
                proxy : new Ext.data.HttpProxy({
                    method: Const.ajaxMethod, // GET
                    url: Const.ajaxUrl,
                    timeout: Const.ajaxHttpTimeout
                }),
                baseParams: {
                    'OP': 'CTL_GET_RESULTS',
                    'ctlConfigId': this.ctlConfigId//,
    //                'start': 0,
    //                'limit': Const.rowsPerPage
                },
                autoLoad: false,
                remoteSort: myobj.configObj['clientSideEnabled'] ? false : true,
    
                // ... other JsonStore configuration details
    
                listeners: {
                    exception: function(proxy, type, action, options, response, arg) {
                        if (type == 'response') {
                            var jsonData = Ext.util.JSON.decode(response.responseText);
                            Ext.MessageBox.alert('ERROR: '+jsonData.errorCode,
                                 jsonData.errorMsg);
                        }
                    },
                    // beforeload and load listeners
                }
            };
    
    
       // use PagingJsonStore if configured for client-side
        if (this.configObj['clientSideEnabled']) {
            // 'exception' event handling DOESN'T WORK
            this.gridStore = new Ext.ux.data.PagingJsonStore(storeConfigObj);
        } else {
            // 'exception' event handling WORKS
            storeConfigObj.baseParams.start = 0;
            storeConfigObj.baseParams.limit = Const.rowsPerPage;
            this.gridStore = new Ext.data.JsonStore(storeConfigObj);
        }
    
        // assign created store to GridPanel
    You can see that the code is identical for the JsonStore and PagingJsonStore cases. Code selects between the two depending upon whether the 'clientSideEnabled' application config attribute is true or false. They both use the same exact Store configuration object, so there is no 'accidental' difference in the configuration between the two cases. The only other differences are that I add the 'start' and 'limit' params to baseParams in the JsonStore case, and set remoteSort to true in the JsonStore case and false in the PagingJsonStore case.

    Thanks for any help you can provide.

  2. #272
    Sencha User
    Join Date
    Jul 2012
    Posts
    3
    Vote Rating
    0
    northmh is on a distinguished road

      0  

    Default


    Quote Originally Posted by Rotterdam View Post
    Hi Condor,

    ....

    In version 0.5 the START and LIMIT params are also being send to the server when retrieving records, version 0.41 did not have this behaviour.

    Is this intentional and what is in your opinion the best way to prevent this without have to do 'server side' adjustments?

    ....
    I had to 'fix' this same issue. Surprised Condor hasn't responded. I'm also surprised that this issue hasn't been reported more. I'm guessing that most people have a server side that doesn't honor the start/limit params, but in my case the solution was implemented with server-side paging and sorting first, and then retrofitted for client-side with the option to toggle between them in configuration. Technically we could have modified the server side to honor the 'client-side' configuration setting, causing it to ignore the start & limit params, but that really would be a hack for what is really a client-side issue.

    I 'fixed' it by changing this in the 'execute' method of PagingStore:

    Code:
                }
                // *** end ***
                this.proxy.request(Ext.data.Api.actions[action], rs, options.params, this.reader, this.createCallback(action, rs, batch), this, options);
            }
            return doRequest;

    To this:

    Code:
                }
                // *** end ***
                delete options.params.start;
                delete options.params.limit;
                this.proxy.request(Ext.data.Api.actions[action], rs, options.params, this.reader, this.createCallback(action, rs, batch), this, options);
            }
            return doRequest;

  3. #273
    Sencha User
    Join Date
    Jul 2012
    Posts
    3
    Vote Rating
    0
    northmh is on a distinguished road

      0  

    Default


    Quote Originally Posted by northmh View Post

    ....

    I have an issue with handling of DataProxy 'exception' events. Previously, when using JsonStore, I assigned an event handler to 'exception' events which just pulls the error message out of the server-side response and displays it in an Ext.MessageBox.alert(...).

    Dropping PagingJsonStore into place breaks that functionality. I've confirmed this by reverting back to JsonStore and it works fine.

    The issue is that it is actually executing my exception handler, but then some later code -- not mine -- is closing the dialog box before it is even visible (I know it isn't mine because I don't have any code anywhere that explicitly closes the box).

    ....
    Nevermind... I had some other code executing in the client-side case which, coupled with some unexpected behavior from Ext, was causing this. I have a client-side filter control that, upon loading new data from the server side, must get re-applied after the load. To do this I added a callback to the store.load() to reapply the filter to the store and refresh the grid and paging toolbars (basically, PagingToolbar.doLoad(0)). But I wasn't checking the 'success' flag in the callback, so it was executing in the failure case, and something in the doLoad(0) call was causing Ext to disappear the error dialog box.

    Changing this:

    Code:
        this.gridStore.load({
            'params': params,
            'callback': function() {
                if (myobj.configObj['clientSideEnabled']) {
                    myobj.clientSideFilter.doFilter();
                }
            }
        });
    to this:

    Code:
        this.gridStore.load({
            'params': params,
            'callback': function(r, options, success) {
                if (success && myobj.configObj['clientSideEnabled']) {
                    myobj.clientSideFilter.doFilter();
                }
            }
        });
    Fixed it.

    (yeah, that's what I get for taking shortcuts and not checking result indicators)

  4. #274
    Sencha User
    Join Date
    Feb 2010
    Location
    Batam, Indonesia
    Posts
    2
    Vote Rating
    0
    computeraholic is on a distinguished road

      0  

    Default


    Thank you, this solved my headache
    Quote Originally Posted by blakel View Post
    There seems to be a problem when using Ext.ux.data.PagingStore with a Ext.ux.PagingToolbar when you never call the load function directly. I have a page where I only call the store's add method to add records. Initially when the page loads there are no records in the store, they are only added when the user presses a button.

    In this case the current page number and the displayInfo are incorrect.

    This is what I did to fix this problem:

    Add a constructor for Ext.ux.data.PagingStore:

    Code:
    constructor: function(config) {
            this.totalLength = 0;
            Ext.ux.data.PagingStore.superclass.constructor.call(this, config);
    },
    At the beginning of the Ext.ux.PagingToolbar's onChange method:

    Change:
    Code:
    if (this.cursor >= t) {
         this.cursor = Math.ceil((t + 1) / s) * s;
    }
    To:
    Code:
    if (this.cursor >= t && this.cursor > 0) {
         this.cursor = Math.ceil((t + 1) / s) * s;
    }

  5. #275
    Sencha User
    Join Date
    Mar 2012
    Posts
    211
    Vote Rating
    0
    hieu79vn is an unknown quantity at this point

      0  

    Default


    Hello

    Does anyone have a complete code/runnable for a paging grid using this Ext.ux.data.PagingStore? Could you give me please?

    Thank you

  6. #276
    Sencha User
    Join Date
    Jul 2011
    Posts
    2
    Vote Rating
    0
    palashkumar1010 is on a distinguished road

      0  

    Default



  7. #277
    Ext JS Premium Member
    Join Date
    Mar 2010
    Location
    Northern Virginia
    Posts
    59
    Vote Rating
    4
    aghextjs is on a distinguished road

      0  

    Default


    My attempt at an Ext JS 4 version of this extension at http://www.sencha.com/forum/showthre...d-for-Ext-JS-4

  8. #278
    Sencha User
    Join Date
    Feb 2013
    Posts
    2
    Vote Rating
    0
    parax is on a distinguished road

      0  

    Default tnx

    tnx


    tnx it is very useful

  9. #279
    Sencha User
    Join Date
    Oct 2013
    Location
    Chandigarh, India
    Posts
    5
    Vote Rating
    0
    PankajG is on a distinguished road

      0  

    Default client side filtering issue when using paging memory

    client side filtering issue when using paging memory


    has there been any workaround on this issue?
    Pankaj Garg | Sr. Software Developer

  10. #280
    Sencha User
    Join Date
    Jan 2014
    Posts
    10
    Vote Rating
    0
    reedcat is on a distinguished road

      0  

    Default


    Someone ported it to Ext 4.1 here:

    https://github.com/aghuddleston/Ext.ux.data.PagingStore

Thread Participants: 106

  1. Animal (3 Posts)
  2. galdaka (2 Posts)
  3. cgi-bin (4 Posts)
  4. tchitani (4 Posts)
  5. tobiu (1 Post)
  6. steffenk (1 Post)
  7. renaudham (1 Post)
  8. markpele (1 Post)
  9. Sesshomurai (1 Post)
  10. teddyjas (5 Posts)
  11. buergi (2 Posts)
  12. Buzzwords (2 Posts)
  13. tomcheng76 (4 Posts)
  14. kveeiv (1 Post)
  15. dhisnotnull (2 Posts)
  16. walldorff (1 Post)
  17. brizardh (2 Posts)
  18. elizard (1 Post)
  19. Remy (1 Post)
  20. renoye (8 Posts)
  21. despay (1 Post)
  22. lwexler (2 Posts)
  23. tomim (1 Post)
  24. Mjollnir26 (1 Post)
  25. allenlako (3 Posts)
  26. Andrea Gioia (1 Post)
  27. wp.joju (1 Post)
  28. genio (2 Posts)
  29. 828 (1 Post)
  30. ljschrenk (4 Posts)
  31. diablo (3 Posts)
  32. blakel (1 Post)
  33. Grolubao (2 Posts)
  34. makiavelli (2 Posts)
  35. elesel (1 Post)
  36. Capt.JackSparrow (2 Posts)
  37. ferryman (3 Posts)
  38. cwford (1 Post)
  39. 3dm (1 Post)
  40. imnilesh (1 Post)
  41. Rotterdam (2 Posts)
  42. nandubochkar (1 Post)
  43. Dustin Graham (1 Post)
  44. Boing (2 Posts)
  45. tdteti_ (8 Posts)
  46. vtulin (2 Posts)
  47. hello (1 Post)
  48. PranKe01 (2 Posts)
  49. jbusuulwa (6 Posts)
  50. cwilson (1 Post)
  51. ronaldploeger (1 Post)
  52. scblue (1 Post)
  53. saadkhan (2 Posts)
  54. subbugv (6 Posts)
  55. p3p3 (1 Post)
  56. computeraholic (1 Post)
  57. calabacita (3 Posts)
  58. aghextjs (1 Post)
  59. Arindam Das (1 Post)
  60. aw_zahid (1 Post)
  61. deister (1 Post)
  62. billprince (1 Post)
  63. amol.gaikwad (2 Posts)
  64. george4rotech (7 Posts)
  65. leonrenkema (1 Post)
  66. mvassau (1 Post)
  67. aDoF96 (2 Posts)
  68. attack11 (3 Posts)
  69. chakrics (1 Post)
  70. thangamalar (3 Posts)
  71. mayurid (1 Post)
  72. Lobo (1 Post)
  73. christian130 (3 Posts)
  74. elbino (3 Posts)
  75. eashwaranp (1 Post)
  76. atul.sachan@capgemini.com (3 Posts)
  77. Joe Kuan (1 Post)
  78. kent78 (4 Posts)
  79. dsk1962 (1 Post)
  80. Woodlander (3 Posts)
  81. msmolyak (1 Post)
  82. mond (4 Posts)
  83. anandhasubha (1 Post)
  84. David Warren (1 Post)
  85. colinm (2 Posts)
  86. sothea (1 Post)
  87. incanus (1 Post)
  88. MarceloCajr (1 Post)
  89. knackwurst (1 Post)
  90. Pattie (1 Post)
  91. parnold3 (1 Post)
  92. StanimirPanchev (1 Post)
  93. palashkumar1010 (1 Post)
  94. ash4aque (3 Posts)
  95. farfar (3 Posts)
  96. PrashanthShetty (1 Post)
  97. brprashanth (2 Posts)
  98. perseusy (3 Posts)
  99. theWalli (1 Post)
  100. hieu79vn (1 Post)
  101. Hisamitsu (1 Post)
  102. hensor (1 Post)
  103. northmh (3 Posts)
  104. parax (1 Post)
  105. PankajG (1 Post)
  106. reedcat (1 Post)
Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi