EXT.js 4 - How can I view data using json with a url to grid

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Exequiel
    Contributor
    • Jul 2012
    • 288

    EXT.js 4 - How can I view data using json with a url to grid

    I don't know how to view data came from my php file to this grid, i'm using this url to use in json or ajax.
    url: '<?php echo base_url();?>in dex.php/process/saveme',
    can anybody help me to view some kind of data came from my php file?

    Code:
    Ext.create('Ext.data.Store', {
        storeId:'listofUsers',
       fields: ['username','password'],
        data:{'items':[
         	{ 'username': 'zick',  "password":"123456"},
            { 'username': 'ikki',  "password":"654321" },
        ]},
        proxy: {
            type: 'memory',
            reader: {
                type: 'json',
                root: 'items'
            }
        }
    });
    
    Ext.create('Ext.grid.Panel', {
        title: 'List of Users',
        store: Ext.data.StoreManager.lookup('listofUsers'),
        columns: [
            { text: 'Username',  dataIndex: 'username',  flex: 1},
            { text: 'Password', dataIndex: 'password' },
        ],
        height: 200,
        width: 400,
        renderTo: Ext.getBody()
    });
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5388

    #2
    the easiest way is to look in Chrome's or Firefox's developer tools an inspect the XHR-requests in the network panels.

    it shows you what u posted and what the request returns.

    Comment

    Working...