Hi,
First, I'm total newbie in Extjs and I just downloaded Extjs.
I am trying get some data to Store using ajax.
My js file
**************************************
Ext.require([
'Ext.data.*'
]);
Ext.onReady(function(){
Ext.define('User', {
extend: 'Ext.data.Model',
fields: ['a', 'b']
});
var store = Ext.create('Ext.data.Store', {
model: 'User',
proxy: {
type: 'ajax',
url : 'json.php'
}
});
store.load();
alert(store.count());
});
***********************************************
and my php-file
**********************************************
<?php
$output = array('a' => 'Apple', 'b' => 'Banana');
header('Content-Type: application/x-json');
echo json_encode($output);
}?>
**********************************************
store.count() return always 0. What is wrong??