View Full Version : Could not get data from ajax

20 Sep 2012, 1:57 AM
im new to ext js, im having problem getting data from ajax to php
i check with firebug in the post tab, there is data with json format but its not available in the php global variables like $_POST, $_REQUEST and $_GET

Ext.define('AM.store.Users', {
extend: 'Ext.data.Store',
model : 'AM.model.User',
autoLoad: true,

proxy: {
type: 'ajax',
api: {
read: 'data/users.php',
update: 'data/updateUser.php'
reader: {
type: 'json',
root: 'users',
successProperty: 'success'


20 Sep 2012, 2:28 AM
php dont parse json post request so you need to get raw post data:

if ($json = @file_get_contents('php://input'))
$json_post = json_decode($json);
$json_post = array();

20 Sep 2012, 7:27 AM
Also, you have to be sure that you use POST PUT GET properly.

21 Sep 2012, 1:38 AM
ajax proxy default api methods:
create: POST
read: GET
update: POST
destroy: POST