1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    4
    Vote Rating
    0
    Martin_Arrowsmith is on a distinguished road

      0  

    Default Unanswered: Using Page Slider with AJAX json data in ExtJS 4

    Unanswered: Using Page Slider with AJAX json data in ExtJS 4


    Hello experts,

    I am having trouble getting my paging slider to work correctly with my ajax json data. The grid loads with all the data, instead of only the 10 elements at a time as specified in my "pageSize" parameter.

    The slider buttons still respond, and I get a "loading" mask, but the entire data is always loaded. Can someone point out what I'm doing wrong? I only want 10 at a time, not the entire data. The code is posted below.

    PHP Code:
    Ext.onReady(function(){

        
    Ext.define('Spyware', {
            
    extend'Ext.data.Model',
            
    idProperty'infection',
            
    fields: [
                {
    name'infection'},
                {
    name'lastseen'type'int'},
                {
    name'firstseen'type'int'},
                {
    name'hitsday'type'int'},
                {
    name'hitsweek'type'int'},
                {
    name'hitsweek'type'int'}
            ]
        });
        
    // Create data store for me.
        
    var weekStore Ext.create('Ext.data.Store', {
            
    model'Spyware',
            
    remoteSorttrue,
            
    pageSize10,
            
    autoLoadtrue,
                
    proxy: {
                
    type'ajax',
                
    url'weekdata.json',
                
    reader: {
                    
    root'week',
                    
    type'json'
                
    }
            }

        });

       
    //-- Now create grid

        
    Ext.create('Ext.grid.Panel', {
            
    title:'Sliding Pager',
            
    storeweekStore,
            
    columns: [{
                    
    id:'infection',
                    
    text'Infection',
                    
    sortabletrue,
                    
    dataIndex'infection',
                    
    flex1
                
    },{
                    
    text'Last Seen',
                    
    sortabletrue,
                    
    dataIndex'lastseen',
                    
    width75
                
    },{
                    
    text'First Seen',
                    
    sortabletrue,
                    
    dataIndex'firstseen',
                    
    width75
                
    },{
                    
    text'Hits Since Yesterday',
                    
    sortabletrue,
                    
    dataIndex'hitsday',
                    
    width75
                
    },{
                    
    text'Hits Last Week',
                    
    sortabletrue,
                    
    dataIndex'hitsweek',
                    
    width75
                
    }],
            
    renderTo'grid-example',
            
    stripeRowstrue,
            
    height:320,
            
    width:600,
            
    bbarExt.create('Ext.PagingToolbar', {
                
    pageSize10,
                
    storeweekStore,
                
    displayInfotrue,
                
    pluginsExt.create('Ext.ux.SlidingPager', {})
            })
        });

    }); 

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,118
    Vote Rating
    453
    Answers
    3160
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Sounds like you are using Ext JS 4.0.7 or older. 4.1.0 beta 1 seems to have fixed these issues.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    4
    Vote Rating
    0
    Martin_Arrowsmith is on a distinguished road

      0  

    Default


    Indeed I am. Glad I asked! Ill try this and get back.

  4. #4
    Sencha User
    Join Date
    Dec 2011
    Posts
    4
    Vote Rating
    0
    Martin_Arrowsmith is on a distinguished road

      0  

    Default Updating wasn't successful

    Updating wasn't successful


    Hi,

    When I updated to the newer version, it still did not work. Any ideas if there is anything wrong with the code above ?

  5. #5
    Sencha User
    Join Date
    May 2012
    Posts
    3
    Vote Rating
    0
    barun17 is on a distinguished road

      0  

    Default


    hi,

    Me too having the same issue, Suggest some solution

Tags for this Thread