Skip to content
Snippets Groups Projects
Commit 8cf05193 authored by Renaud Le Gac's avatar Renaud Le Gac
Browse files

Remove obsolete code.

Add the constant App.DB
Add two new functions App.longFieldName and App.fieldString
parent 2b973d49
No related branches found
No related tags found
No related merge requests found
/**
* Define name space and constants
* @author R. Le Gac
* @version $id$
* @version $Id$
*
*/
Ext.namespace('App', 'App.factory');
App.DB_URL = '/mdvPostInstall/database';
/*
App.factory.JsonStore
A JsonStore Factory customized for the application and related database.
configuration object is those of the EXt.data.JsonStore.
baseParams have to be completed by the steering keywords:
fields, q, ....
*/
Ext.namespace('App');
App.factory.JsonStore = function(config){
var js = new Ext.data.JsonStore(Ext.apply({
baseParams: {
'debug': false,
'service': 'select',
},
root: 'data',
url: App.DB_URL,
}, config));
return js;
};
/*
App.factory.ajax.request
config parameters param have to defined
More work need to decode properly errors.
*/
App.DB = 'db'
App.DB_URL = '/mdvPostInstall/database';
App.factory.AjaxRequest = function(config){
var ar = Ext.Ajax.request(Ext.apply({
failure: function(response, options){
Ext.MessageBox.alert('Status', response.reponseText);
},
method: 'POST',
success: function(response, options){
resp = Ext.util.JSON.decode(response.responseText);
if (!resp.success){
Ext.MessageBox.alert('Status', resp.msg);
}
//console.log(resp.msg);
},
url: App.DB_URL
}, config));
App.longFieldName = function(table, field){
return App.DB+'.'+table+'.'+field
}
return ar;
};
\ No newline at end of file
App.fieldString = function(table, field, operator, value){
return App.longFieldName(table, field)+operator+value
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment