PDA

View Full Version : defining success and failure handlers within httpProxy



flamant
29 Jan 2011, 1:11 AM
Hi,

I use Ext.data.HttpProxy within a JsonStore this way :



var remoteGridProxy = new Ext.data.HttpProxy({
api:{
read: { url: '../secure/getSubjectDataGrid.htm', method: 'GET' },
create: { url: '../secure/createSubjectDataGrid.htm', method: 'POST' },
update: { url: '../secure/updateSubjectDataGrid.htm', method: 'POST' },
destroy: { url: '../secure/deleteSubjectDataGrid.htm', method: 'POST' }
}
});




var remoteGridJsonStore = new Ext.data.JsonStore({
proxy: remoteGridProxy,
.......
.......
});



I don't how to implement the success and failure handlers for the 4 CRUD operations

Thank you in advance for your answers

valititi
29 Jan 2011, 2:03 AM
Ok ,man ! Please don't take it bad, but... We were 3 guys disputing for helping you in your previous post for... Finally for what ? For a simple syntax error with and simple invalid answer, then for a simple POST data... Now, you (we) finish, you need to handle the callback. Ok. Do you already write some code ? Or only you... wish to implement it ? I am sure that there will be some guys who will really copy-paste here code for you. But, honestly, this is not the correct way... Try to work a little bit more by yourself... The most of the time, what people give as answers, are simply copy-paste from THE GOOD EXT DOC !

You see, guys even "dispute" for giving answers ! But, they make with big pleasure, when they can see that TRIED something. To be 100% honest, I bet that for this callback handler you read exactly... Nothing !!! And you hope in some divine copy-paste to fit into stuff. What you, you need is not help, I think. But training !
For answer to your question,
http://www.sencha.com/learn/Ext_FAQ_Grid

flamant
29 Jan 2011, 6:31 AM
I apologies for my previous post. Effectively the error was obvious but it can happen.
I took bad what you are saying. I really read the EXTJS API documentation before sending a post and I am also looking for the answer before.
I can tell you that for 80% of my post the answer was not obvious. Sometimes I could look for the answer furthermore and I will do that from now.
For this post nothing is specified in the API documentation neither in the FAQ about the success and failure handler within DataProxy and HttpProxy using api object. I also search on internet without success

msinn
31 Jan 2011, 3:19 AM
var remoteGridJsonStore = new Ext.data.JsonStore({
proxy: remoteGridProxy,
.......
.......
});

I don't how to implement the success and failure handlers for the 4 CRUD operations

Thank you in advance for your answers

play a little bit with the listener exception of your JsonStore



listeners:{
exception: function(proxy, type, action, options, response, arg){
// your error handling code
console.error(" Exception: \nProxy: %1.o \nType: %s \nAction: %s \nOptions: %1.o \nResponse: %1.o \nArguments: %1.o ",proxy, type, action, options, response, arg);
},