← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7610: Data entry, triggering a custom event when form is loaded so that scripts in custom forms can hoo...

 

------------------------------------------------------------
revno: 7610
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2012-07-14 20:16:59 +0200
message:
  Data entry, triggering a custom event when form is loaded so that scripts in custom forms can hook into it
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2012-07-12 14:08:48 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2012-07-14 18:16:59 +0000
@@ -61,6 +61,8 @@
 var FORMTYPE_SECTION = 'section';
 var FORMTYPE_DEFAULT = 'default';
 
+var EVENT_FORM_LOADED = "dhis-web-dataentry-form-loaded";
+
 /**
  * Page init. The order of events is:
  *
@@ -785,6 +787,8 @@
 
     dataEntryFormIsLoaded = true;
     hideLoader();
+    
+    $( 'body' ).trigger( EVENT_FORM_LOADED );
 }
 
 function valueFocus( e )