mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 09:25:43 +01:00
added Sonia.rest.JsonStore
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
<script type="text/javascript" src="resources/extjs/ext-all-debug.js"></script>
|
||||
|
||||
<script type="text/javascript" src="resources/js/global.js"></script>
|
||||
<script type="text/javascript" src="resources/js/sonia.rest.js"></script>
|
||||
<script type="text/javascript" src="resources/js/sonia.login.js"></script>
|
||||
<script type="text/javascript" src="resources/js/sonia.group.js"></script>
|
||||
<script type="text/javascript" src="resources/js/sonia.repository.js"></script>
|
||||
|
||||
@@ -98,7 +98,7 @@ var groupSelModel = new Ext.grid.RowSelectionModel({
|
||||
singleSelect: true
|
||||
});
|
||||
|
||||
var groupStore = new Ext.data.JsonStore({
|
||||
var groupStore = new Sonia.rest.JsonStore({
|
||||
url: restUrl + 'groups.json',
|
||||
root: 'groups',
|
||||
fields: [
|
||||
|
||||
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