dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #18456
[Branch ~dhis2-documenters/dhis2/dhis2-docbook-docs] Rev 558: Link function docs
------------------------------------------------------------
revno: 558
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2-docbook-docs
timestamp: Tue 2012-07-31 12:14:22 +0200
message:
Link function docs
modified:
src/docbkx/en/dhis2_user_man_web_api.xml
--
lp:~dhis2-documenters/dhis2/dhis2-docbook-docs
https://code.launchpad.net/~dhis2-documenters/dhis2/dhis2-docbook-docs
Your team DHIS 2 developers is subscribed to branch lp:~dhis2-documenters/dhis2/dhis2-docbook-docs.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-documenters/dhis2/dhis2-docbook-docs/+edit-subscription
=== modified file 'src/docbkx/en/dhis2_user_man_web_api.xml'
--- src/docbkx/en/dhis2_user_man_web_api.xml 2012-07-31 09:35:01 +0000
+++ src/docbkx/en/dhis2_user_man_web_api.xml 2012-07-31 10:14:22 +0000
@@ -628,11 +628,21 @@
<tgroup cols="5">
<tbody>
<row>
- <entry>Param</entry>
- <entry>Type</entry>
- <entry>Required</entry>
- <entry>Options (default first)</entry>
- <entry>Description</entry>
+ <entry>
+ <emphasis role="italic">Param</emphasis>
+ </entry>
+ <entry>
+ <emphasis role="italic">Type</emphasis>
+ </entry>
+ <entry>
+ <emphasis role="italic">Required</emphasis>
+ </entry>
+ <entry>
+ <emphasis role="italic">Options (default first)</emphasis>
+ </entry>
+ <entry>
+ <emphasis role="italic">Description</emphasis>
+ </entry>
</row>
<row>
<entry>indicators</entry>
@@ -663,7 +673,7 @@
<entry>Names of relative periods to include in table</entry>
</row>
<row>
- <entry>organisationunits</entry>
+ <entry>orgunits</entry>
<entry>[string]</entry>
<entry>Yes</entry>
<entry/>
@@ -698,13 +708,6 @@
<entry>Whether the table should be rendered as plain HTML or as an Ext JS Grid</entry>
</row>
<row>
- <entry>format</entry>
- <entry>string</entry>
- <entry>No</entry>
- <entry>html | xls | csv | pdf | json | xml</entry>
- <entry>The representation format of the table, can be HTML, Excel, CSV, PDF, JSON and XML</entry>
- </row>
- <row>
<entry>el</entry>
<entry>string</entry>
<entry>Yes</entry>
@@ -723,31 +726,78 @@
</table>
<para>In the following are examples on how the table plugin can be used.</para>
<screen>DHIS.getTable({
- indicators: ['Uvn6LCg7dVU'],
- periods: ['last12Months'],
- orgunits: ['ImspTQPwCqd'],
- crosstab: ['periods'],
- orgUnitIsParent: true,
- useExtGrid: false,
- callbackName: 'table1',
- hiddenCols: [0],
- el: 'table1',
- url: base
- });
+ indicators: ['Uvn6LCg7dVU'],
+ periods: ['last12Months'],
+ orgunits: ['ImspTQPwCqd'],
+ crosstab: ['periods'],
+ orgUnitIsParent: true,
+ useExtGrid: false,
+ callbackName: 'table1',
+ hiddenCols: [0],
+ el: 'table1',
+ url: base
+});
DHIS.getTable({
- dataelements: ['s46m5MS0hxu', 'YtbsuPPo010', 'xc8gmAKfO95', 'UOlfIjgN8X6'],
- periods: ['last4Quarters'],
- orgunits: ['ImspTQPwCqd'],
- crosstab: ['data'],
- useExtGrid: false,
- callbackName: 'table2',
- el: 'table2',
- url: base
- });</screen>
+ dataelements: ['s46m5MS0hxu', 'YtbsuPPo010', 'xc8gmAKfO95', 'UOlfIjgN8X6'],
+ periods: ['last4Quarters'],
+ orgunits: ['ImspTQPwCqd'],
+ crosstab: ['data'],
+ useExtGrid: false,
+ callbackName: 'table2',
+ el: 'table2',
+ url: base
+});</screen>
<para>Finally we insert in the Web page the div elements which are referred to in the table configuration and used to render the tables.</para>
<screen><div id="table1"></div>
<div id="table2"></div></screen>
<para>To view a complete working example please visit <ulink url="http://apps.dhis2.org/portal/table.html"/>.</para>
+ <para>You can also choose to provide a link to the report table instead of rendering it directly on the web page. The configuration of the link function is very similar to the table function and shares the <emphasis role="italic">indicators</emphasis>, <emphasis role="italic">dataelements</emphasis>, <emphasis role="italic">datasets</emphasis>, <emphasis role="italic">periods</emphasis>, <emphasis role="italic">orgunits</emphasis>, <emphasis role="italic">orgUnitIsParent</emphasis>, <emphasis role="italic">crosstab</emphasis> and <emphasis role="italic">url</emphasis> properties. There is only one additional parameter which is listed in the table below.</para>
+ <table>
+ <title>Link plugin (additional) configuration</title>
+ <tgroup cols="5">
+ <tbody>
+ <row>
+ <entry>
+ <emphasis role="italic">Param</emphasis>
+ </entry>
+ <entry>
+ <emphasis role="italic">Type</emphasis>
+ </entry>
+ <entry>
+ <emphasis role="italic">Required</emphasis>
+ </entry>
+ <entry>
+ <emphasis role="italic">Options (default first)</emphasis>
+ </entry>
+ <entry>
+ <emphasis role="italic">Description</emphasis>
+ </entry>
+ </row>
+ <row>
+ <entry>format</entry>
+ <entry>string</entry>
+ <entry>No</entry>
+ <entry>html | xls | csv | pdf | json | xml</entry>
+ <entry>The representation format of the table, can be HTML, Excel, CSV, PDF, JSON and XML</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>Below is an example on how to use the link function. The link URL is retrieved from the <emphasis role="italic">getUrl</emphasis> function and later set as target for a link the HTML document.</para>
+ <screen>var url1 = DHIS.getUrl({
+ indicators: ['Uvn6LCg7dVU'],
+ periods: ['last12Months'],
+ orgunits: ['ImspTQPwCqd'],
+ crosstab: ['periods'],
+ orgUnitIsParent: true,
+ format: 'xls',
+ url: base
+});
+
+Ext.get('link1').set({href: url1});</screen>
+ <para>The link HTML element can be defined in the body section of the document like below.</para>
+ <screen><a id="link1">Download as Excel</a></screen>
+ <para>To view a complete working example please visit <ulink url="http://apps.dhis2.org/portal/table.html"/>.</para>
</section>
</chapter>