1. #1
    Ext JS Premium Member
    Join Date
    Aug 2010
    Posts
    18
    Vote Rating
    0
    sferg989 is on a distinguished road

      0  

    Default Answered: Data Difficulty in Extjs4 paging grid!!

    Answered: Data Difficulty in Extjs4 paging grid!!


    I am having problems getting data to show up in the grid. can someone help me

    Here is my code/ form the data is coming in

    Code:
    Ext.define('User', {
        extend: 'Ext.data.Model',
        fields: [
                {
                    name : 'task_code', 
                    type : 'string'
                },{
                    name : 'lastname',  
                    type : 'string'
            }]
    });
    
    
    var userStore = Ext.create('Ext.data.Store', {
        pageSize : $page_size,
        model    : 'User',
        autoLoad : true,
        proxy: {
            type: 'ajax',
            url: '$self?get_json=yes'
        },
        reader: {
                type : 'json',
                root : 'rows',
                totalProperty: 'totalCount'
                }
    });
    Ext.create('Ext.grid.Panel', {
        renderTo : divGrid,
        store    : userStore,
        width    : viewport_width,
        height   : viewport_height,
        title    : 'Application Users',
        columns  : [
            {
                text      : 'Task Name',
                width     : 250,
                sortable  : false,
                hideable  : false,
                dataIndex : 'lastname'
            },
            {
                text      : 'Task code',
                width     : 150,
                dataIndex : 'task_code',
                hidden    : false
            },
            {
                text      : 'Task code',
                flex      : 1,
                dataIndex : 'task_code'
            }
        ],
        dockedItems: [{
            xtype: 'pagingtoolbar',
            store: userStore,
            dock: 'bottom'
        }]
    });

    Here is the form of my data

    Code:
    {
    "success": true,
    "totalCount": 714, 
     "rows": [{            
        "task_code": "A15340",            
        "lastname" : "ENG020b PM FTD1 Test Travel"        
    },{          
         "task_code": "A15290",           
        "lastname" : "ENG021a PM FTD2 Test Travel"        
    },{           
        "task_code": "A15380",          
        "lastname" : "ENG022c PM FTD3 Test Travel"        
    },{           
        "task_code": "A15400",           
        "lastname" : "ENG024b PM FFS1 Test Travel"
    }
    ]}
    -->

  2. Maybe it's the reader that sould be inside the proxy.
    Code:
    var userStore = Ext.create('Ext.data.Store', {
        pageSize : $page_size,
        model    : 'User',
        autoLoad : true,
        proxy: {
            type: 'ajax',
            url: '$self?get_json=yes',
            reader: {
                type : 'json',
                root : 'rows',
                totalProperty: 'totalCount'
            }
        }
    });

  3. #2
    Sencha User lucasguaru's Avatar
    Join Date
    May 2011
    Location
    Guaruj√°, Brazil
    Posts
    77
    Vote Rating
    2
    Answers
    9
    lucasguaru is on a distinguished road

      0  

    Default


    Maybe it's the reader that sould be inside the proxy.
    Code:
    var userStore = Ext.create('Ext.data.Store', {
        pageSize : $page_size,
        model    : 'User',
        autoLoad : true,
        proxy: {
            type: 'ajax',
            url: '$self?get_json=yes',
            reader: {
                type : 'json',
                root : 'rows',
                totalProperty: 'totalCount'
            }
        }
    });
    -->

  4. #3
    Ext JS Premium Member
    Join Date
    Aug 2010
    Posts
    18
    Vote Rating
    0
    sferg989 is on a distinguished road

      0  

    Default fixed

    fixed


    That was it, Thank you
    -->

Thread Participants: 1