Results 1 to 6 of 6

Thread: Error in paging

  1. #1
    Sencha User
    Join Date
    Aug 2015
    Posts
    9
    Vote Rating
    0
      0  

    Default Error in paging

    I'm not getting the same number of records which I want in particular page.
    I have a grid in which i want to use paging
    Here is my grid
    Ext.define('dc.view.sgx.PositionAccountGrid', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.dc-sgx-positionaccountgrid',
    requires: [ 'xgen.lang' ],
    //_sqlQuery: 'OptionCover_query',
    _queryDetails:'',
    _repoQuery:'POSITIONACC',
    viewConfig: {
    preserveScrollOnRefresh: true
    },
    autoScroll: true,
    store:'PositionAccountDetail',


    initComponent: function () {
    Ext.apply(this, {
    width:800,
    columns: [
    ......
    ],
    bbar: {
    xtype: 'pagingtoolbar',
    store: 'PositionAccountDetail',
    displayInfo: true,
    displayMsg: 'Displaying {0} to {1} of {2}  records ',
    emptyMsg: "No records to display ",

    }

    });
    this.callParent(arguments);
    }
    });

    Here is my store

    Ext.define('dc.store.PositionAccountDetail', {
    extend: 'Ext.data.Store',
    alias: 'store.dc-positionaccountdetail',
    requires: ['xgen.xci'],
    autoSync: true,
    model: 'dc.model.PositionAccountDetail',
    pageSize: 10,

    remoteSort: true,
    groupers: [
    { property: 'ParticipantID', direction: 'ASC' }
    ],
    sorters: [
    { property: 'RequestId', direction: 'DESC' }
    ],
    proxy: Ext.create('xgen.data.Proxy', {
    request: 'FilterMapping',
    root: 'FilterMappingResponse.MsgData.Values',

    error: function (resp, opt, respObj) {
    // Intentionally do nothing as long as we can't check for a specific error
    },

    }),


    });

  2. #2
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446
    Vote Rating
    186
      0  

    Default

    Hi--

    Is your server returning the correct data? Can you share an example of the issue you're experiencing?

    https://fiddle.sencha.com

    Thanks!
    Joel

  3. #3
    Sencha User
    Join Date
    Aug 2015
    Posts
    9
    Vote Rating
    0
      0  

    Default

    Yup! data is correct the main issue is that It is returning total records on a single page/first page. Records are not divided according to the pagesize.
    It is difficult to show a live example of my problem.

  4. #4
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446
    Vote Rating
    186
      0  

    Default

    Quote Originally Posted by aakashgarg View Post
    Yup! data is correct the main issue is that It is returning total records on a single page/first page. Records are not divided according to the pagesize.
    It is difficult to show a live example of my problem.
    Hi--

    With paging, the agreement between the request made by the store's proxy and the server is simply a "handshake"--the store is not going to do any manipulation of the data received from the server in order to enforce a particular number of records per page; it's merely going to consume what the server gives to it. So then, each response from the server for paged data should include the total size of the result set, as well as the individual page of data that corresponds to that particular request: e.g., if your page size is 25, the request for page 1 should include the first 25 records from the total set, page 2 the next 25, and so on.

    Thanks!
    Joel

  5. #5
    Sencha User
    Join Date
    Aug 2015
    Posts
    9
    Vote Rating
    0
      0  

    Default

    I understood that what you want to explain but can you please tell me the code of how to do the same ??

  6. #6
    Sencha User
    Join Date
    Oct 2013
    Posts
    54
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by aakashgarg View Post
    I understood that what you want to explain but can you please tell me the code of how to do the same ??


    When your proxy url is called, along with the URL 3 querystring parameters will be added &page=1&start=0&limit=15.


    using this querystring parameters you have to manipulate your data and bring only the number of records required for a page.


    For example:


    if you are using DB query to pull data.


    start=0
    limit=20(your page size)
    page=1(your page number)


    endingrow=(page-1)*limit


    select top (limit) from table1 where id not in (select top (endingrow) id from table1)

Similar Threads

  1. paging grid error
    By witchupan in forum Ext GWT: Help & Discussion (1.x)
    Replies: 6
    Last Post: 14 Nov 2008, 4:29 AM
  2. Paging Toolbar sometimes (!) causes error
    By Arcomat in forum Ext 2.x: Help & Discussion
    Replies: 22
    Last Post: 28 Nov 2007, 3:13 AM
  3. Javascript Error in Paging example
    By srinath in forum Ext 1.x: Help & Discussion
    Replies: 6
    Last Post: 11 Jun 2007, 11:31 PM
  4. IE Error with Paging Grid
    By nation-x in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 3 May 2007, 1:30 PM

Tags for this Thread

Posting Permissions

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