PDA

View Full Version : Ext.data.HttpProxy: create script



realruntime
24 Feb 2011, 4:21 AM
Hello, all

In the API documentation of Ext.data.HttpProxy it says:


api: {
load : '/controller/load',
create : '/controller/new', // Server MUST return idProperty of new record
save : '/controller/update',
destroy : '/controller/destroy_action'
}How is this idProperty to return? Just a


print $id;if the script is a PHP script? Any fancy sort of JSON structure?

Thanks in advance,
Peter

Condor
24 Feb 2011, 6:38 AM
No, it should return the entire record, just like you would for 'load'.

That remark is just a reminder that the server is supposed to create a new id for the record and return it.

realruntime
24 Feb 2011, 12:35 PM
Thanks for your answer. If I use the Ext.data.ArrayReader for "load", do I have to return this new record in the data format for the ArrayReader? (i. e. [ 'val1', 'val2', 'val3' ] )

Is there also a special return value for the create script?