By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,191 Members | 1,256 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,191 IT Pros & Developers. It's quick & easy.

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

Exequiel
100+
P: 287
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();?>index.php/process/saveme',
can anybody help me to view some kind of data came from my php file?

Expand|Select|Wrap|Line Numbers
  1. Ext.create('Ext.data.Store', {
  2.     storeId:'listofUsers',
  3.    fields: ['username','password'],
  4.     data:{'items':[
  5.          { 'username': 'zick',  "password":"123456"},
  6.         { 'username': 'ikki',  "password":"654321" },
  7.     ]},
  8.     proxy: {
  9.         type: 'memory',
  10.         reader: {
  11.             type: 'json',
  12.             root: 'items'
  13.         }
  14.     }
  15. });
  16.  
  17. Ext.create('Ext.grid.Panel', {
  18.     title: 'List of Users',
  19.     store: Ext.data.StoreManager.lookup('listofUsers'),
  20.     columns: [
  21.         { text: 'Username',  dataIndex: 'username',  flex: 1},
  22.         { text: 'Password', dataIndex: 'password' },
  23.     ],
  24.     height: 200,
  25.     width: 400,
  26.     renderTo: Ext.getBody()
  27. });
  28.  
Jul 22 '13 #1
Share this Question
Share on Google+
1 Reply


gits
Expert Mod 5K+
P: 5,333
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.
Jul 22 '13 #2

Post your reply

Sign in to post your reply or Sign up for a free account.