-<div id="cls-Ext.direct.JsonProvider"></div>/**\r
- * @class Ext.direct.JsonProvider\r
- * @extends Ext.direct.Provider\r
- */\r
-Ext.direct.JsonProvider = Ext.extend(Ext.direct.Provider, {\r
- parseResponse: function(xhr){\r
- if(!Ext.isEmpty(xhr.responseText)){\r
- if(typeof xhr.responseText == 'object'){\r
- return xhr.responseText;\r
- }\r
- return Ext.decode(xhr.responseText);\r
- }\r
- return null;\r
- },\r
-\r
- getEvents: function(xhr){\r
- var data = null;\r
- try{\r
- data = this.parseResponse(xhr);\r
- }catch(e){\r
- var event = new Ext.Direct.ExceptionEvent({\r
- data: e,\r
- xhr: xhr,\r
- code: Ext.Direct.exceptions.PARSE,\r
- message: 'Error parsing json response: \n\n ' + data\r
- })\r
- return [event];\r
- }\r
- var events = [];\r
- if(Ext.isArray(data)){\r
- for(var i = 0, len = data.length; i < len; i++){\r
- events.push(Ext.Direct.createEvent(data[i]));\r
- }\r
- }else{\r
- events.push(Ext.Direct.createEvent(data));\r
- }\r
- return events;\r
- }\r
-});</pre>
+<div id="cls-Ext.direct.JsonProvider"></div>/**
+ * @class Ext.direct.JsonProvider
+ * @extends Ext.direct.Provider
+ */
+Ext.direct.JsonProvider = Ext.extend(Ext.direct.Provider, {
+ parseResponse: function(xhr){
+ if(!Ext.isEmpty(xhr.responseText)){
+ if(typeof xhr.responseText == 'object'){
+ return xhr.responseText;
+ }
+ return Ext.decode(xhr.responseText);
+ }
+ return null;
+ },
+
+ getEvents: function(xhr){
+ var data = null;
+ try{
+ data = this.parseResponse(xhr);
+ }catch(e){
+ var event = new Ext.Direct.ExceptionEvent({
+ data: e,
+ xhr: xhr,
+ code: Ext.Direct.exceptions.PARSE,
+ message: 'Error parsing json response: \n\n ' + data
+ });
+ return [event];
+ }
+ var events = [];
+ if(Ext.isArray(data)){
+ for(var i = 0, len = data.length; i < len; i++){
+ events.push(Ext.Direct.createEvent(data[i]));
+ }
+ }else{
+ events.push(Ext.Direct.createEvent(data));
+ }
+ return events;
+ }
+});</pre>