1. #51
    Ext User
    Join Date
    Oct 2009
    Location
    Barcelona
    Posts
    14
    Vote Rating
    0
    tdteti_ is on a distinguished road

      0  

    Default Ext.ux.data.PagingStore

    Ext.ux.data.PagingStore


    Sorry !!
    I have already downloaded it using 'Google Chrome'. I will try then with this!!

    Thanks a lot Condor!!

  2. #52
    Ext User
    Join Date
    Oct 2009
    Location
    Barcelona
    Posts
    14
    Vote Rating
    0
    tdteti_ is on a distinguished road

      0  

    Default Import and using "PagingStore.js"...

    Import and using "PagingStore.js"...


    Sorry again Condor but I am so new using ExtJs 3.0 library...
    I have placed the "PagingStore.js" downloaded file inside a new folder:
    "../ext-3.0.0/ux/data/PagingStore.js" since to "ux/data" path does not exist on ExtJs 3.0 library.
    Then, on my code I have put it:
    ...
    <script language="javascript" src="js/ext-3.0.0/ux/data/PagingStore.js" type="text/javascript"></script>
    ...
    ...
    var countries = [
    ['ABW','ARUBA','ARUBA'],['AFG','AFGHANISTAN','AFGHANISTAN'],...
    ];

    var store = new Ext.ux.data.PagingStore({
    fields: [
    {name: 'code',type:'string'},
    {name: 'value',type:'string'},
    {name: 'tooltip', type:'string'}
    ],
    data: countries,
    lastOptions: {params: {start: 0, limit: 5}}
    });
    ...
    ...
    Now it is not working... ! I have put it correctly? How I must 'import' the "PagingStore.js" file and use it?
    Thanks again for all your help!!

  3. #53
    Ext User
    Join Date
    Feb 2008
    Posts
    200
    Vote Rating
    2
    tomcheng76 is on a distinguished road

      0  

    Default


    Is this better?

    Code:
        insert: function(index, records) {
            //find reference for snapshot first
            var refindex = -1, refrecord = null;
            if (index > 0){
                refindex = index - 1;
                refrecord = this.data.itemAt(refindex);
            }else if (index == 0){
                refindex = 0;
                refrecord = this.data.itemAt(refindex);
            }
            records = [].concat(records);
            for (var i = 0, len = records.length; i < len; i++) {
                this.data.insert(index, records[i]);
                records[i].join(this);
            }
            if (this.allData) {
                //this.allData.addAll(records);
                for (var i = 0, len = records.length; i < len; i++) {
                    this.allData.insert(this.start + index, records[i]);
                }
            }
            if (this.snapshot) {
                refindex = this.snapshot.indexOf(refrecord);
                if (refrecord != null && refindex != -1){
                    if (index > 0){
                        refindex++;
                        for (var i = 0, len = records.length; i < len; i++) {
                            this.snapshot.insert(refindex, records[i]);
                        }
                    }else if (index == 0){
                        for (var i = 0, len = records.length; i < len; i++) {
                            this.snapshot.insert(refindex, records[i]);
                        }
                    }
                }else{
                    this.snapshot.addAll(records);
                    //for (var i = 0, len = records.length; i < len; i++) {
                    //    this.snapshot.insert(0, records[i]);
                    //}
                }
            }
            this.fireEvent("add", this, records, index);
        },

  4. #54
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    94
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Or a bit shorter:
    Code:
    Ext.override(Ext.ux.data.PagingStore, {
        insert: function(index, records) {
            records = [].concat(records);
            var i, len = records.length, ix;
            for (i = 0; i < len; i++) {
                this.data.insert(index, records[i]);
                records[i].join(this);
            }
            if (this.allData) {
                ix = (this.start || 0) + index;
                for (i = 0; i < len; i++) {
                    this.allData.insert(ix, records[i]);
                }
            }
            if (this.snapshot) {
                ix = index ? this.snapshot.indexOf(this.data.getAt(index - 1)) + 1 : 0;
                for (i = 0; i < len; i++) {
                    this.snapshot.insert(ix, records[i]);
                }
            }
            this.fireEvent("add", this, records, index);
        }
    });

  5. #55
    Ext User
    Join Date
    Oct 2009
    Location
    Barcelona
    Posts
    14
    Vote Rating
    0
    tdteti_ is on a distinguished road

      0  

    Default Ext.ux.data.PagingStore - Refreshes total pages number after the filter?

    Ext.ux.data.PagingStore - Refreshes total pages number after the filter?


    Sorry by the annoyances! I found the problem (nothing to do with the path,...). Finally I created a " PagingArrayStore" after import the "PagingStore.js" correctly and now it is working properly!! Thanks ...

    Only one more thing, please: The only point to which it seems is failing (or better, it is not working as expected) is that after the filter, the total pages number is not updated (refreshed) until the next page button is pressed.
    Example: The data are the all countries = 206 items. Due to the pageSize es equals to 5, I have (initially) total pages = 42 --> CORRRECT!!
    The issue is that after I type (i.e) the letter 'S' to filter the countries, the query and filter are working correctly, but the total pages indicated on toolbar continue being 42, ONLY after presses the '>' button (i.e) that number is refreshed with the correct number of pages for the countries starting with 'S', it means 5 pages due to I have 25 countries starting with 'S' (pageSize = 5).
    Then, there is some way to overwrite the Keypress event in order to trigger the refresh event after the query and filter are executed?

    Thanks again for all!!

  6. #56
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    94
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    That's a problem of PagingToolbar, not of Store.

    You could try this patch.

  7. #57
    Ext User
    Join Date
    Oct 2009
    Location
    Barcelona
    Posts
    14
    Vote Rating
    0
    tdteti_ is on a distinguished road

      0  

    Default It already works!!!

    It already works!!!


    Hi Condor,
    I have put it the patch and it is now working perfectly!!!
    Thanks a lot for your help!!!!

  8. #58
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,507
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    How do I use it?

    I want to load all the data. So start and l limit are irrelevant - the DB will return the full dataset.

    And then I want it to page 10 by 10 from the loaded data.

    It's actually making an HTTP request for each page.

  9. #59
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,507
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Oops. Hang on, I changed the wrong Store

  10. #60
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,507
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Of course it works fine when I change the right Store to be a 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)