1. #101
    Ext User
    Join Date
    Nov 2008
    Posts
    47
    Vote Rating
    0
    genio is on a distinguished road

      0  

    Default


    ooh yes, found it!

    I guess the limitation can make it confusing for the user... I will investigate how it looks.

    Now, on the paging front, is it actually possible to make the page size configurable for the user? I guess that would be more of a paging Tool bar issue, but I have not found any references on this in the forum...

  2. #102
    Ext User
    Join Date
    Nov 2009
    Posts
    77
    Vote Rating
    0
    saadkhan is on a distinguished road

      0  

    Default


    Hello Condor,
    I downloaded you extension of paging for local data but unfortunately it did not work for me.
    I am doing things like this, please do correct me...

    My store:
    Code:
    var megaStore = new Ext.data.ArrayStore({
        fields:
        [
            'VehicleId',
            'VehicleNumber',
            'CustomerName',
            'DeviceType',
            'CustomerId',
            'CustomerFatherName',
            'CustomerMotherMaidenName',
            'CustomerCNIC',
            'CustomerAddress',
            'CustomerOfficeAddress',
            'CustomerWebtrackUsername'
        ],
        lastOptions: {params: {start: 0, limit: 5}},
        remoteSort:true
    });

    Filling data in store:
    Code:
    //  A .NET extension which calls server-side method and returns with data
    Autotrack.Remote.getAllInformation({
            success: function(basicFrom, action)
            {
                // action.result.data has the returned data
                Ext.iterate(action.result.data, function(prop, value)
                {
                    newDataRow = {
                                  VehicleId: prop,
                                  VehicleNumber: value['VehicleNumber'],
                                  CustomerName: value['CustomerName'],                              
                                  DeviceType: value['DeviceType'],
                                  DeviceId: value['DeviceId'],
                                  CustomerId: value['CustomerId'],
                                  CustomerFatherName: value['CustomerFatherName'],
                                  CustomerCNIC: value['CustomerCNIC'],
                                  CustomerMotherMaidenName: value['CustomerMotherMaidenName'],
                                  CustomerAddress: value['CustomerAddress'],
                                  CustomerOfficeAddress: value['CustomerOfficeAddress'],
                                  CustomerWebtrackUsername: value['CustomerWebtrackUsername']
                                };
                    newRecord = new megaStore.recordType(newDataRow);
                    megaStore.add(newRecord);                
                });
            }
        });
    My grid:
    Code:
    var manageCustomerWindowGrid = new Ext.grid.GridPanel({
                store: megaStore,
                hideHeaders: true,
                layoutConfig:
                {
                    autoExpandColumn: 'customerName', autoExpandMin: 550, autoHeight: true
                },
                autoExpandColumn: 'customerName', autoExpandMin: 550, autoHeight: true,
                cm: new Ext.grid.ColumnModel({                
                    columns: 
                    [
                        { id:'customerName', header: "CustomerName", dataIndex: 'CustomerName', renderer: function(value,p,r){ return String.format("<b>{0}</b><br />{1} {2} {3}<br />", value, r.data['VehicleNumber'], r.data['DeviceType'], r.data['VehicleName']); }}
                    ]
                }),            
                trackMouseOver: false,
                bbar: new Ext.PagingToolbar({
                    pageSize: 5,
                    store: megaStore,
                    displayInfo: true,
                    displayMsg: 'Displaying Customers {0} - {1} Of {2}',
                    emptyMsg: "No Customers To Display"
                })
            });
    Still my grid shows all the data at once and no paging thing works. Please guide me what should I do now. I am stuck in it!

  3. #103
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    91
    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


    Ext.data.ArrayStore -> Ext.ux.data.PagingArrayStore

  4. #104
    Ext User
    Join Date
    Nov 2009
    Posts
    77
    Vote Rating
    0
    saadkhan is on a distinguished road

      0  

    Default


    Quote Originally Posted by Condor View Post
    Ext.data.ArrayStore -> Ext.ux.data.PagingArrayStore
    Didnt work!
    I replaced Ext.data.ArrayStore with Ext.ux.data.PagingArrayStore...is that all I needed to do?

  5. #105
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    91
    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


    remoteSort:true? You are using local data!

    Also, you are not loading the store. Instead, you are adding the records one by one. If you do that you need to call applyPaging() after you are done.

    ps. I woujld recommend loading the store, because it's faster.

  6. #106
    Ext User
    Join Date
    Apr 2010
    Location
    Orlando, FL
    Posts
    61
    Vote Rating
    0
    george4rotech is on a distinguished road

      0  

    Default getting error "recordType is undefined"

    getting error "recordType is undefined"


    Trying to use your plugin, below are the "before"/"after" versions of my store. When I convert to using your PagingArrayStore, I get the error "recordType is undefined" from line 23540 of ext-3.2.1/ext-all-debug.js.

    Could it be because the "RecordType" parameter being pass to "new Ext.data.ArrayReader" is not "a Record constructor created from Ext.data.Record.create." but rather the other permissible parameter, "an Array of Field definition objects"?

    Or maybe could it be because I initially define the data as []? I do this to begin with as the grid will be empty, but depending on an event, then the data gets populated through a call to loadData

    By the way, the before code for the store is largely based on what was generated by Ext Designer, all I added are the mappings. Thanks in advance.

    Before:
    Code:
            this.store = new Ext.data.Store({
                autoDestroy : true,
                reader : new Ext.data.ArrayReader({}, [{
                    name : 'locId', mapping: 'locId'
                    }, {
                    name : 'locName', mapping: 'locName'
                    }, {
                    name : 'locCity', mapping: 'locCity'
                    }, {
                    name : 'locState', mapping: 'locState'
                    }, {
                    name : 'hasAccess', mapping: 'hasAccess'
                }]),
                data : []
            });
    After:
    Code:
            this.store = new Ext.ux.data.PagingArrayStore({
                autoDestroy : true,
                reader : new Ext.data.ArrayReader({}, [{
                    name : 'locId', mapping: 'locId'
                    }, {
                    name : 'locName', mapping: 'locName'
                    }, {
                    name : 'locCity', mapping: 'locCity'
                    }, {
                    name : 'locState', mapping: 'locState'
                    }, {
                    name : 'hasAccess', mapping: 'hasAccess'
                }]),
                data : [],
                lastOptions: {params: {start: 0, limit: 25}}
            });
    Last edited by george4rotech; 18 May 2010 at 11:02 AM. Reason: additional information that may be relevant

  7. #107
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    91
    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


    You can't specify a reader in a PagingArrayStore (or an ArrayStore for that matter).
    For that you need a normal PagingStore.

  8. #108
    Ext User
    Join Date
    Apr 2010
    Location
    Orlando, FL
    Posts
    61
    Vote Rating
    0
    george4rotech is on a distinguished road

      0  

    Default


    Switching to your PagingStore did the trick, thanks. What's particularly impressive is that it all works along with our own extension to PagingToolbar.

  9. #109
    Ext User
    Join Date
    Oct 2009
    Posts
    3
    Vote Rating
    0
    Boing is on a distinguished road

      0  

    Default


    Hello,
    I was able to get the paging to load the data I got from a remote function that returns a proper json object,
    In this case it's "data:FnQueryQCTracker()" that queries an access database (yeah I know lame). Yay, Woohoo, kudos to your add-on, it's great!
    However, I have not been able to get the function to run again when you click on the refresh button.

    I've searched for hours for anything that would help, but I could not find anything.

    I tried adding the override mentioned in the first message, however, it didn't work.
    Where exactly do you place the override functions/statements?
    Or is something else wrong?

    Here is my code, if you happen to find anything wrong with it.

    PHP Code:
    var store = new Ext.ux.data.PagingArrayStore({
         
    fields: [
              {
    name:"submissionNumber"},
              {
    name"submitDate",
                   
    type'date',
                   
    dateFormat'D m/d/Y H:i:s'
              
    },
              {
    name'submitProc'},
              {
    name'submitName'},
              {
    name'locationOne'},
              {
    name'locationTwo'},
              {
    name'qcStatus'},
              {
    name'qcMember',type:'string'},
              {
    name'completeDate',
                   
    type'date',
                   
    dateFormat'D m/d/Y H:i:s'
               
    },
               {
    name:'qcComments'},
               {
    name'emailHTML'}
         ],
         
    dataFnQueryQCTracker(),
         
    lastOptions: {params: {start0limit25}}
    }); 
    PHP Code:
    var ObjGrid = new Ext.grid.GridPanel({
         
    autoExpandColumn"submitName",
         
    autoScrolltrue,
         
    clicksToEdit1,
         
    columnLinesfalse,
         
    cmObjColModel,
         
    enableColumnMovefalse,
         
    enableHdMenufalse,
         
    headerfalse,
         
    height700,
         
    hideBordersfalse,
         
    id'qc-t-grid',
         
    //layout: 'fit',
         
    plugins: [editor],
         
    region'west',
         
    sm:new Ext.grid.RowSelectionModel({
              
    singleSelect:true,
              
    listeners: {
                   
    selectionchange: function(sel){
                        var 
    rec sel.getSelected();
                        if(
    rec){
                             
    Ext.getCmp('qcPreview').body.update(rec.get('emailHTML'));
                        }
                   }
              }
         }),
         
    split'true',
         
    statefultrue,
         
    stateId'grid',
         
    storestore,
         
    stripeRowstrue,
         
    title'QC Tracker',
         
    viewConfig: {
              
    forceFit:true
         
    },
         
    width600,
         
    // paging bar on the bottom
         
    bbar: new Ext.PagingToolbar({
              
    pageSize25,
              
    storestore,
              
    displayInfotrue,
              
    displayMsg'Displaying topics {0} - {1} of {2}',
              
    emptyMsg"No topics to display"
         
    })
    }); 
    Just as a side note, would this work ok with a task mgr to auto update the store?

    Thank you very much for your time and help. Sorry to bother.

  10. #110
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    91
    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


    Did you use the override mentioned in the first post?
    Code:
    Ext.override(Ext.PagingToolbar, {
        refresh: function(){
            delete this.store.lastParams;
            this.doLoad(this.cursor);
        }
    });
    If the number of records you are loading is substantial (>100) and the number of modified records is relatively low (<10%) I would recommend doing a separate Ajax request to only get the changed records and update the records currently in the store.

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)