3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
\r
4 <title>The source code</title>
\r
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
8 <body onload="prettyPrint();">
\r
9 <pre class="prettyprint lang-js"><div id="cls-Ext.direct.JsonProvider"></div>/**
\r
10 * @class Ext.direct.JsonProvider
\r
11 * @extends Ext.direct.Provider
\r
13 Ext.direct.JsonProvider = Ext.extend(Ext.direct.Provider, {
\r
14 parseResponse: function(xhr){
\r
15 if(!Ext.isEmpty(xhr.responseText)){
\r
16 if(typeof xhr.responseText == 'object'){
\r
17 return xhr.responseText;
\r
19 return Ext.decode(xhr.responseText);
\r
24 getEvents: function(xhr){
\r
27 data = this.parseResponse(xhr);
\r
29 var event = new Ext.Direct.ExceptionEvent({
\r
32 code: Ext.Direct.exceptions.PARSE,
\r
33 message: 'Error parsing json response: \n\n ' + data
\r
38 if(Ext.isArray(data)){
\r
39 for(var i = 0, len = data.length; i < len; i++){
\r
40 events.push(Ext.Direct.createEvent(data[i]));
\r
43 events.push(Ext.Direct.createEvent(data));
\r