PDA

View Full Version : Proxy: api: update dont execute



HEILEENDURLEY
10 Apr 2013, 6:28 AM
Hi, i have the following trouble:
using extjs 4.1.0 i do the next insert:

43049
When i click over button insert the api create execute and this is the result:
43050

in post execute the api create.

Well, using 4.2.0.663 i have the same code and my result is following:
43052

It runs the create api. The api update,read and destroy works, but create no.
i have the next configuration for the store:



model: modelName,
autoLoad: true,
autoSync: true,
proxy: {
type: 'ajax',
api: {
read: url + ((apiRead == null)? 'listAll' : apiRead),
create: url + ((apiCreate == null)? 'insert' : apiCreate),
update: url + ((apiUpdate == null)? 'save' : apiUpdate),
destroy: url + ((apiDestroy == null)? 'delete' : apiDestroy)
},
reader: { type: readerType, root: 'data', successProperty: 'success', messageProperty: 'message', totalProperty: 'total' },
writer: { type: 'json', root: 'data', writeAllFields: true },
listeners: {
exception: function(proxy, response, operation){

json = Ext.JSON.decode(response.responseText);
if( json.message!=null && json.message!='' )
Ext.Msg.alert('REMOTE EXCEPTION', json.message);

Ext.MessageBox.show({
title: 'REMOTE EXCEPTION',
msg: operation.getError(),
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});

if( operation.action == 'create' )
this.storeBase.remove( operation.records[0] );
}
}
},


what's is different in 4.0.2 change something?

I hope can find the solution.

slemmon
12 Apr 2013, 8:58 AM
You might start by examining how you set up your code versus this example here:
http://docs.sencha.com/ext-js/4-2/extjs-build/examples/writer/writer-jsonp.html
which demonstrates the CRUD operations - including the create.