Extjs4 connection example

extjs Ext.data.Connection example

 function(){
    	    	var conn = Ext.create('Ext.data.Connection');
    	    	//define a variable to parse json String returned from server.
                var resul = {
    	    		success: false,
    	    		msg: ''
    	    	};
    	    	conn.request({
    	    		url: './addTempPlan.action',
    	    		callback: function(options,succ,response){
    	    			resul = Ext.JSON.decode(response.responseText);
    	    			if(succ){
    	    				Ext.Msg.alert('Success',resul.msg);
    	    			}else{
    	    				Ext.Msg.alert('Failure',resul.msg);
    	    			}
    	    		}
    	    	});
    	    }
 the server: String json = "{\"success\":true,\"msg\":\"execute success!\"}";
This entry was posted in Computer, Java. Bookmark the permalink.

One Response to Extjs4 connection example

  1. Anonymous says:

    Thanks a lot, really useful for new EXT user🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s