hedera-web/web/js/hedera/report.js

86 lines
1.6 KiB
JavaScript
Raw Normal View History

2015-09-22 07:20:47 +00:00
Vn.Report = new Class
({
2015-08-17 18:02:14 +00:00
Extends: Vn.Object
2015-09-22 07:20:47 +00:00
,initialize: function (props)
{
2015-09-22 07:20:47 +00:00
this.parent (props);
this.open ();
}
,showWindow: function ()
{
var reportWindow = window.open ('js/hedera/report.html', reportPath,
'resizable=yes,height=600,width=750,scrollbars=yes,menubar=no');
//report.print ();
Vn.includeCss ('reports/'+ reportPath +'/style.css');
window.document.body.appendChild (this.node);
var report = new Vn.Report (reportWindow.document.body);
return reportWindow;
}
/**
2015-09-22 07:20:47 +00:00
* Gets an object from the builder associated to this report.
*
* @param {string} objectId The object identifier
* @return {Object} The object, or %null if not found
**/
,$: function (objectId)
{
2015-08-17 18:02:14 +00:00
if (this.builder)
return this.builder.get (objectId);
return null;
}
/**
* Called when the form is opened.
**/
,open: function ()
2015-09-22 07:20:47 +00:00
{
this.builder = new Vn.Builder ();
this.builder.signalData = this;
2015-09-22 07:20:47 +00:00
this.builder.loadXml (Vn.getXml ('reports/'+ this.reportPath +'/report.xml'));
2015-03-06 23:33:54 +00:00
this.node = this.builder.get ('form');
var models = this.builder.getObjects ('db-model');
for (var i = 0; i < models.length; i++)
models[i].conn = this.conn;
2015-07-17 14:34:42 +00:00
var queries = this.builder.getObjects ('db-query');
for (var i = 0; i < queries.length; i++)
queries[i].conn = this.conn;
}
/**
* Called when the form is activated.
**/
,activate: function () {}
2015-09-22 07:20:47 +00:00
/**
* Called when the form is deactivated.
**/
,deactivate: function () {}
/**
2015-01-31 01:05:12 +00:00
* Called when the form is closed.
**/
,close: function ()
{
2015-09-22 07:20:47 +00:00
this.builder.unref ();
this.builder = null;
}
2015-08-17 18:02:14 +00:00
,_destroy: function ()
{
this.close ();
this.parent ();
2015-08-17 18:02:14 +00:00
}
});