Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

Playing with json-rpc call using sencha touch

$
0
0

Hi,

In an old life :-), i was using jquery-rpc for sending json data such as :

Code:
$(document).ready(function() 
{
    $.jsonRPC.setup({endPoint: '/rpc/abusfake.sh', namespace: 'DmngCoreStub' }).request('getCapabilities', 
    {
	params: {},
	success: function(result)
        {
            //alert("[JSON-RPC] Getting the device capabilities : OK ");
	    console.log("[JSON-RPC] Getting the device capabilities : OK ");
            //alert(_objectIntrospection(myjson));


            if (result.result != null)
            {
		_setJsonToLocalstorage('jsonDmngCapabilities', myConfigJsonResult);
            }
        },
        
        error: function(result)
        {
	    var msg = '';
	    
            //alert("[JSON-RPC] Error message = ".result.error.message);
	    console.log("[JSON-RPC] Error message = ".result.error.message);
	    
            if (result.error.message != null)	msg += result.error.message;
            else				msg += result.error;
	    
            //alert("[JSON-RPC] Getting the device capabilities : NOK (" + msg + ")");
	    console.log("[JSON-RPC] Getting the device capabilities : NOK (" + msg + ")");
	}
    });
    
    $.jsonRPC.setup({endPoint: '/rpc/abusfake.sh', namespace: 'DmngCoreStub' }).request('getConfig', 
    {
	params: {},
	success: function(result)
        {
            //alert("[JSON-RPC] Getting the device configuration : OK ");
	    console.log("[JSON-RPC] Getting the device configuration : OK ");
            //alert(_objectIntrospection(result.result));
	    
            if (result.result != null)
            {
		_setJsonToLocalstorage('jsonDmngConfig', myConfigJsonResult);
            }
        },
        
        error: function(result)
        {
	    var msg = '';
	    
            //alert("[JSON-RPC] Error message = ".result.error.message);
	    console.log("[JSON-RPC] Error message = ".result.error.message);
	    
            if (result.error.message != null)	msg += result.error.message;
            else				msg += result.error;
            
	    //alert("[JSON-RPC] Getting the device configuration : NOK (" + msg + ")");
	    console.log("[JSON-RPC] Getting the device configuration : NOK (" + msg + ")");
	}
    });
});

I wanna know if sencha touch 2, have one similar way to play with json-rpc function ?

Thanks your for your reply

Regards.

Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>