-
18 Apr 2012 5:58 AM #1
Answered: How to handling the RowEditing update button?
Answered: How to handling the RowEditing update button?
Hi, I can speak a little english.
I have a question.
I want to handling RowEditing component "Update" button.
if i click the "Update" button, then "proxy" params set, pass my server. i want it.
My model proxy type "ajax" set, but why "rest" pass my server?
plz help me.......
1.jpg2.jpgPHP Code:/** my model.. */
Ext.define('WFM.model.ContentModel', {
extend: 'Ext.data.Model',
proxy: {
type: 'ajax',
api: {
read: 'ContentAction',
create: 'ContentAction?mode=create',
update: 'ContentAction?mode=update',
destroy: 'ContentAction?mode=remove'
},
reader: {
type: 'json'
//root: 'users'
},
writer: {
type: 'json'
}
},
fields: [
{name: 'name', type: 'string'},
{name: 'memo', type: 'string'},
{name: 'date', type: 'string'},
{name: 'type', type: 'string'},
{name: 'size', type: 'string'},
{name: 'owner', type: 'string'}
]
});
-
Best Answer Posted by scottmartin
You will need to create a custom writer to perform this. Something like:
This example will pass the fields as params:
Regards,Code:writer: { type: 'json', writeRecords:function(request, data){ Ext.apply(data[0],request.params); request.jsonData = Ext.urlEncode(data[0]); return request; } }
Scott
-
18 Apr 2012 7:35 AM #2Sencha - Support Team
- Join Date
- Jul 2010
- Location
- Houston, Tx
- Posts
- 7,186
- Vote Rating
- 194
- Answers
- 433
You will need to create a custom writer to perform this. Something like:
This example will pass the fields as params:
Regards,Code:writer: { type: 'json', writeRecords:function(request, data){ Ext.apply(data[0],request.params); request.jsonData = Ext.urlEncode(data[0]); return request; } }
Scott
-
18 Apr 2012 8:02 AM #3


Reply With Quote