added Sonia.rest.JsonStore

This commit is contained in:
Sebastian Sdorra
2010-09-05 16:34:04 +02:00
parent 0fb9478f19
commit a8eb96e06a
3 changed files with 30 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
Ext.ns("Sonia.rest");
Sonia.rest.JsonStore = Ext.extend( Ext.data.JsonStore, {
constructor: function(config) {
var baseConfig = {
autoLoad: true,
listeners: {
// fix jersey empty array problem
exception: {
fn: function(proxy, type, action, options, response, arg){
if ( action == "read" && response.responseText == "null" ){
this.removeAll();
}
},
scope: this
}
}
};
Sonia.rest.JsonStore.superclass.constructor.call(this, Ext.apply(config, baseConfig));
}
});