2 Nov 2011 12:28 PM #1
Ext.Direct - not calling destroy method
I've been trying to get up and running with Ext.direct as it looks like a rather elegant way to get to data via PHP/MySQL. In doing so, I have watched the video "Ext Direct through PHP router" ( http://www.sencha.com/forum/showthre...-and-php-Video ) - which is very helpful.
I have this sample code up and running in my environment and I have also adapted it to an app for testing. However, I can only seem to read in data when I adapt the code to my my test app. I see that the methods get loaded to the proxy.api and I set a listener on my store to listen for remove events - which does indeed fire. But when I look at my network panel in the developer console, I do not see any call to router.php when I call store.remove(). The only reference to router.php is when the store is initially loaded (or when I subsequently call store.load() )
Has anyone come across anything like this?
3 Nov 2011 8:11 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
Do you see any update or create methods going through?
You probably need to set autoSync to true on your store or call sync() on the store to send the changes.Mitchell Simoens @LikelyMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
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 firstname.lastname@example.org
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
4 Nov 2011 12:40 AM #3
I was not seeing any other calls being made. That is to say that update and create would indeed be in the API, but I did not see a call getting made to them.
I think I've figured it out though. In the example code, the query returns a column 'id', but in my test code I was not using/returning a column 'id'. Once I started returning 'id' from the query calls to destroy started working.
I'm not sure if 'id' is required as part of Ext.direct or not, perhaps I've missed it in the documentation and tutorials - will go back for another look.
Thanks for your reply.
4 Nov 2011 4:22 AM #4
Looks like I needed to set idProperty in my model.
Now it works.