-
18 Apr 2012 8:52 AM #1
Store/Model/Proxy
Store/Model/Proxy
Hi all,
i create a Store with Model and Proxy. I configure Proxy for Ajax request with associated api like following:
Ext.define('xxxxx.store.yyyyyy', {
extend: 'Ext.data.Store',
model: 'xxxxxx.model.yyyyyyy',
autoLoad: true,
autoSync: true,
sorters: [
{property: 'id', direction: 'ASC'}
],
});
Ext.define('xxxxxx.model.yyyyyyy',{
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: 'string'},
{name: 'group', type: 'string'},
......
],
idProperty:'id',
proxy: {
type: 'ajax',
api: {
read: 'scripts/read.php',
create: 'scripts/user.php?action=create',
update: 'scripts/user.php?action=update',
destroy:'scripts/user.php?action=destroy'
},
reader: {
type: 'json',
root: 'passwords'
},
writer: {
type: 'json',
writeAllFields: true,
root: 'passwords'
}
});
Every time i ask for store.sync(); php file doesn't receive any call.
The only one who works is read api. Any ideas?
Sorry for my poor english.
-
18 Apr 2012 10:30 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
Did you look in the network tab of developer tools to see if you see the request fire off? Any errors?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
18 Apr 2012 11:51 AM #3
i made these two test:
first test:
var XYZ = getXYZStore();
XYZ.sync();
nothing done in network tab and no error on console tab
second test:
this.getXYZStore.sync();
on console tab returns this error:
Uncaught TypeError: Object function () { return fn.apply(scope, args.concat(Ext.Array.toArray(arguments))); } has no method 'sync'
i use GPL Ext 4.0.7 library.
thanks
-
18 Apr 2012 12:12 PM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
probably should beCode:this.getXYZStore.sync();
Code:this.getXYZStore().sync();
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
18 Apr 2012 12:20 PM #5
yes i make a mistake while typing
this.getXYZStore().sync(); nothing on Network Tab
this.getXYZModel().save(): error:
Uncaught TypeError: Object function () { return this.constructor.apply(this, arguments); } has no method 'save'
I'm going mad!!
Is there any example about MVC with CRUD method and PHP file working?
-
8 May 2012 12:44 AM #6
https://github.com/ErnestoR/Extjs4_PHP_MySQL
re: "Is there any example about MVC with CRUD method and PHP file working?"Donnie Martin - noob cake
Ext JS 4.1 & Architect 2.0 - Ajax/LAMP
"My email address is older than you, not kidding"


Reply With Quote