All the business logic of the generated app is encapsulated in main.js. You will see a section for each widget added. Each widget section will have the following inside the widget object:
- Global variable declarations. For eg,
this.serverUrl = 'http://saasmob.com/rapid/widgets/';
this.serviceUrl = this.serverUrl+'services/';
this.currentaction = '';
this.appid = '143' ;
this.widgetid = '1';
this.apikey = '249-169-77-182-213-17-88-183' ;
this.initPerformed = 0;
- Definitions of objects used in the widget
- switchDisplayDiv() to switch between DIVs of the widget
- parseServerXML() to parse responses from webservice (Data is sent to webservice via itaObject.doAction('sync'). See the API for all parameters
- doAction() takes parameters like( action, param1,param2,param3 etc) and performs the corresponding action.
action: to tell what action is going to be performed
param1: mostly it contains the id of the objects, but can have any value depends on the need
param2: passed if required.
- doDBAction() is used to perform all db access
|