Page 27 of 29 FirstFirst ... 172526272829 LastLast
Results 261 to 270 of 285

Thread: Ext.ux.data.PagingStore [v0.5]

  1. #261
    Sencha User
    Join Date
    Dec 2011
    Posts
    4
    Vote Rating
    0
      0  

    Default

    Thanks a lot!!!

  2. #262
    Sencha User
    Join Date
    Feb 2012
    Posts
    13
    Vote Rating
    0
      0  

    Question Hoping there is a ExtJS 4.x version

    PagingMemoryProxy really limited every operation in "current page".....
    Why not just enhance the MemoryStore to support paging?

  3. #263
    Sencha User
    Join Date
    Mar 2012
    Posts
    1
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by Buzzwords View Post
    Ignore my previous question. I've found the functionality I was looking for. PagingMemoryProxy is just what I needed. It allows Ext.toolbar.Paging to control paging of local data contained in an Ext.data.Store. Very helpful! The code behind the Sliding Pager example under the Extjs4 Grid Examples clearly demonstrates usage.
    Thank you!!

  4. #264
    Sencha User
    Join Date
    Feb 2009
    Posts
    10
    Vote Rating
    0
      0  

    Default

    Has anyone example for PagingJsonStore for ExtJs 4?
    I need to store all remote data in local store with paging.
    Ang use this store for grid with filtering and reloading.
    But I cant find any solution with remote data.

  5. #265
    Sencha User
    Join Date
    Feb 2012
    Posts
    13
    Vote Rating
    0
      0  

    Default my paging grid sample using local data with filters and celleditors

    Grid definition:
    Code:
    Ext.define('myGrid', {
        extend: 'Ext.panel.Panel',
     alias: 'widget.mygrid',
        layout: {
            type: 'border'
        },
     requires: [
      'Ext.grid.*',
      'Ext.data.*',
      'Ext.toolbar.Paging',
      'Ext.ux.grid.FiltersFeature'
     ],
     
     defaults: {
      split: true
     },
     
     initComponent: function() {
      Ext.log({
       msg: Ext.getClassName(this) + '.initComponent: ' + 'start',
       level: 'info',
       stack: false
      });
      
      this.items = [{
       xtype: 'gridpanel',
       itemId: 'grdSearchResult',
       region: 'center',
       forceFit: false,
       selType: 'cellmodel',
       columns: [{
        xtype: 'gridcolumn',
        itemId: 'colNameSpace',
        text: 'Name Space',
        sortable: true,
        hideable: false,
        menuDisabled: false,
        draggable: true,
        groupable: false,
        dataIndex: 'name_space',
        minWidth: 100,
        filter: {
         type: 'string'
        },
        editor: {
         xtype: 'textfield',
         readOnly : true
        }
       }],
       plugins: [
        Ext.create('Ext.grid.plugin.CellEditing', {
         clicksToEdit: 2
        })
       ],
       features: [{
        ftype: 'filters',
        encode: false,  // json encode the filter query
        local: true  // defaults to false (remote filtering)
       }],
       dockedItems: [{
        xtype: 'pagingtoolbar',
        itemId: 'tbrPaging',
        dock: 'bottom',
        displayInfo: true,
        displayMsg: 'Displaying {0} - {1} of {2}',
        emptyMsg : 'No data to display',
        items: [
        '-',
        {
         xtype: 'numberfield',
         itemId: 'nbfPageSize',
         fieldLabel: 'Records Per Page',
         labelAlign: 'right',
         value: 20,
         size: 5,
         minValue: 1,
         allowDecimals: false
        },
        '-',
        {
         xtype: 'button',
         itemId: 'btnClearFilter',
         text: 'Clear All Filters'
        }]
       }],
       viewConfig: {
       }
      }];
      
      this.callParent(arguments);
        }
    });
    My controller definition:
    Code:
    Ext.define('myController', {
        extend: 'Ext.app.Controller',
     
        init: function() {
      var me = this;
      
            this.control({
               '.mygrid > #grdSearchResult > #tbrPaging > #nbfPageSize': {
        'change': {fn: this.setPageSize, scope: this, single: false}
                },
                '.mygrid > #grdSearchResult > #tbrPaging > #btnClearFilter': {
                    'click': {fn: this.clearFilter, scope: this, single: false}
                }
             });
        },
        
     doSearch: function(grdResult) {
      var me = this;
      var tbrPaging = grdResult.child('#tbrPaging');
      var nbfPageSize = tbrPaging.child('#nbfPageSize');
      
      var arrayTable = new Array();
      
      //get all data in arrayTable
      
      var pagingStore = grdResult.getStore();
      if (pagingStore) pagingStore.removeAll(false);
      
      pagingStore = Ext.create('myStore');
      grdResult.reconfigure(pagingStore);
      tbrPaging.bindStore(pagingStore);
      
      pagingStore.getProxy().data = arrayTable;
      pagingStore.pageSize = nbfPageSize.getValue();
      pagingStore.load();
     },
      setPageSize: function(fieldThis, newValue, oldValue, eOpts) {
      var grdSearchResult = fieldThis.up('#tbrPaging').up('#grdSearchResult');
      var store = grdSearchResult.getStore();
      if (store) store.pageSize = fieldThis.getValue();
     },
     
       clearFilter: function(fieldThis, event, eOpts) {
      var grdSearchResult = fieldThis.up('#tbrPaging').up('#grdSearchResult');
      grdSearchResult.filters.clearFilters();
     }
    });
    The store:
    Code:
    Ext.define('myStore', {
        extend: 'Ext.data.Store',
        model: 'myModel',
     
     requires: [
      'Ext.ux.data.PagingMemoryProxy'
     ],
     
     autoLoad: false,
     pageSize: 20,
     proxy: {
      type: 'pagingmemory',
      reader: {
       type: 'json'
      }
     }
    });
    The Model:
    Code:
    Ext.define('myModel', {
        extend: 'Ext.data.Model',
        fields: [
            {name: 'name_space', type: 'string'}
        ]
    });

  6. #266
    Sencha User
    Join Date
    Mar 2012
    Posts
    3
    Vote Rating
    0
      0  

    Default

    Thanks for this example.
    I tried to rebuild your code but i can't get it working.
    The toolbar is visible and shows the correct numbers. eg.
    at the moment I have 21 records and a page size of 10.
    It shows that there are 3 pages etc. but on every page I can see all of my 21 records...

    Can you post a snippet where the data is loaded too?

  7. #267
    Sencha User
    Join Date
    Feb 2009
    Posts
    10
    Vote Rating
    0
      0  

    Default

    I also tried without any result. Can you provie snippet?

  8. #268
    Sencha User
    Join Date
    Feb 2012
    Posts
    13
    Vote Rating
    0
      0  

    Default

    I am on my vacation right now and will post later.


    --- I had updated the post adding the definition of store and model.

  9. #269
    Sencha User
    Join Date
    Dec 2011
    Posts
    18
    Vote Rating
    0
      0  

    Default Regarding Grid Filtering in PagingMemory Proxy

    Hi,

    We are using Extjs 4.1 pagingMemoryProxy for one of our requirements.

    Presently we see issue in Grid filtering in the same.
    1. Load Grid with 10 items per page of 50 records
    2. Try Filtering in the First column, with the textvalue which is there in last page of store
    3. Filtered data is not paginated correctly, meaning if the filtered record is in 5th Page, Then user has to navigate to 5th page to see the records & all the other 4 pages says No Records in Grid.
    Please let us know if any fix/work arround for this issue.

    Thanks,
    Prashanth
    Thanks,
    Prashanth

  10. #270
    Sencha User
    Join Date
    Jun 2012
    Posts
    1
    Vote Rating
    0
      0  

    Default Problems when adding several records to the store.

    I'm loading rows into my gridpanel via several loads, where I add the new rows to the excisting store. This does not play well with PagingStore. Are there some sort of fix/hack for this to be supported as well?

    I'm using v0.5 and ExtJS 3.3.1.

Page 27 of 29 FirstFirst ... 172526272829 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •