mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 17:26:22 +01:00
added Sonia.rest.JsonStore
This commit is contained in:
28
scm-webapp/src/main/webapp/resources/js/sonia.rest.js
Normal file
28
scm-webapp/src/main/webapp/resources/js/sonia.rest.js
Normal 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));
|
||||
}
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user