Forum
/
Sencha Touch 1.x Forums
/
Sencha Touch 1.x: Discussion
/
-
13 Sep 2011 5:49 AM #1
Proxy Action Method DELETE, PUT, GET
Hi all
I am very new to sencha and like it much but I have some trouble to understand the proxy use. I have defined the following proxy within my store:
Code:proxy: { type: 'ajax', url : 'calendarData.php', reader: { type: 'json', root: 'calendarList' }, actionMethods: { create: 'POST', read: 'GET', update: 'PUT', destroy: 'DELETE' } }
thx
katam -
13 Sep 2011 6:57 AM #2
I know that if you want to pass some parameters from client to server via a proxy ,you must use 'extraParams' config in the proxy.
for example :
Code:extraParams: {data: variable},
-
13 Sep 2011 11:56 AM #3
Yes that's what I did meanwhile..
Code:proxy: { type: 'ajax', url : 'calendarData.php', reader: { type: 'json', root: 'calendarList' } }
Code:remove: function(params) { this.store.proxy.extraParams = { fromDate: params.record.data.fromDate, toDate: params.record.data.toDate, ... action: 'delete' }; this.store.remove(params.record); this.store.sync(); this.index(); }
By the way... I still don't know how to access the browser's "request payload" param on server side (php in my case). Thx as well for any hints on this.
Cheers and Thanks for reply
katam -
13 Sep 2011 6:56 PM #4
-
Join Date
- Jan 2009 Location
- Palo Alto, California Posts
- 1,941 Vote Rating
- 5
Are you tying a Form directly in to a Proxy here? Usually it's easier to just use Ext.Ajax.request with the form element. It's been a while since I had to do this myself but this should work:
Code:var myForm = new Ext.form.FormPanel({...}); Ext.Ajax.request({form: myForm.getEl()});
Ext JS Senior Software Architect
Personal Blog: http://edspencer.net
Twitter: http://twitter.com/edspencer
Github: http://github.com/edspencer -
14 Sep 2011 1:12 PM #5
thanks ed
see I am just new working with sencha. I did much with jquery in the past but the I wanted to design a small application for me and my friends.. Then I checked out what available frameworks are around and I found Sencha Touch... absolutly best performance of all frameworks... congrats for that and your team. So what I need is to create a calendar tool which simply checks if date ranges are free in the calender and book it. So I just have a list and a form and I do sync all this directly with my php server. So in fact I think I do not need a store here. Anyway I was coming throw a Sencha Touch MVC example.. I coudn't find one which describes the way using a server and no Storage... Now I finally almost reach the goal and finish it...
I think the way you describe is directly use the proxy instance instead of working with a storage, right? I see.
PS. I love my old bro IE6 as well