← Back to team overview

dhis2-devs team mailing list archive

Javascript goes to offline

 

Dear All,
               Please help me .
               I am trying to create a custom form with 9 dataelement.onchange event of the dataelement call the oc_avb() function ,which check that dataelement value become "NaN " or "Negative" ,if it is true it is replace by "0".

It is work perfectly but system become slow and system goes to off line mode.
Any one please help to rectify the error. 

<script>
/* This function is call onchange event of  dataelement and checked if the dataelement value become NaN it replace by '0' and if dataelement value become negetive replace by '0'*/
function oc_avb(cgid){
                        v2=$("#"+cgid).val();
                          if(isNaN(v2)||v2<0)
                              {
                               $("#"+cgid).val(0);
                              }
                                                     
                           if (v2>=0)  
                          { $("#"+cgid).val(v2);
                          }
                        $("#"+cgid).change(); 
 };  
 };  

   
</script></p>
<table align="center" bgcolor="#FFFFE0" border="1" cellpadding="1" cellspacing="1" style="width: 400px;">
<tbody>
<tr>
<td style="text-align: center;width:300px">
Bed Type</td>
<td style="text-align: center;width:100px">
Available Bed</td>
</tr>
<tr>
<td>
<div style="font-size: 14px; color: red;">
<strong>Cardiothoracic And Vascular Surgery&nbsp;Intensive Therapy Unit(CTVS ITU)</strong></div>
</td>
<td style="text-align: center;">
<input id="Wuin0SXuPNj-Y8qBmhmsqyj-val" onchange="oc_avb(this.id);" style="width: 5em; text-align: center ;font-weight:bold;color:red;border-style:solid;border-color:#07AC09;" title="Wuin0SXuPNj - Available Cardiothoracic And Vascular Surgery(CTVS ITU) - Y8qBmhmsqyj - (default) - int" value="[ Available Cardiothoracic And Vascular Surgery(CTVS ITU) (default) ]" /></td>
</tr>
<tr>
<td>
<div style="font-size: 14px; color: red;">
<strong>Emergency Bed(EM Bed)</strong></div>
</td>
<td style="text-align: center;">
<input id="QWNLnXFyksX-Y8qBmhmsqyj-val" onchange="oc_avb(this.id);" style="width: 5em; text-align: center ;font-weight:bold;color:red;border-style:solid;border-color:#07AC09;" title="QWNLnXFyksX - Available  Emergency Bed(EM) - Y8qBmhmsqyj - (default) - int" value="[ Available  Emergency Bed(EM) (default) ]" /></td>
</tr>
<tr>
<td>
<div style="font-size: 14px; color: red;">
<strong>High DependencyUnit(HDU)</strong></div>
</td>
<td style="text-align: center;">
<input id="yYtnZv1vGl7-Y8qBmhmsqyj-val" onchange="oc_avb(this.id);" style="width: 5em; text-align: center ;font-weight:bold;color:red;border-style:solid;border-color:#07AC09;" title="yYtnZv1vGl7 - Available High Dependency Unit(HDU) - Y8qBmhmsqyj - (default) - int" value="[ Available High Dependency Unit(HDU) (default) ]" /></td>
</tr>
<tr>
<td>
<div style="font-size: 14px; color: red;">
<strong>Intensive Cradiac Care Unit (ICCU)</strong></div>
</td>
<td style="text-align: center;">
<input id="SIsEeVOISOS-Y8qBmhmsqyj-val" onchange="oc_avb(this.id);" style="width: 5em; text-align: center ;font-weight:bold;color:red;border-style:solid;border-color:#07AC09;" title="SIsEeVOISOS - Available Intensive Cardiac Care unit(ICCU) - Y8qBmhmsqyj - (default) - int" value="[ Available Intensive Cardiac Care unit(ICCU) (default) ]" /></td>
</tr>
<tr>
<td>
<div style="font-size: 14px; color: red;">
<strong>Intensive Therapy Unit A(ITU A)</strong></div>
</td>
<td style="text-align: center;">
<input id="xpjyW71hK6m-Y8qBmhmsqyj-val" onchange="oc_avb(this.id);" style="width: 5em; text-align: center ;font-weight:bold;color:red;border-style:solid;border-color:#07AC09;" title="xpjyW71hK6m - Available Intensive Therapy Unit A(ITU A) - Y8qBmhmsqyj - (default) - int" value="[ Available Intensive Therapy Unit A(ITU A) (default) ]" /></td>
</tr>
<tr>
<td>
<div style="font-size: 14px; color: red;">
<strong>Intensive Therapy Unit B(ITU B)</strong></div>
</td>
<td style="text-align: center;">
<input id="vcgdbpDugas-Y8qBmhmsqyj-val" onchange="oc_avb(this.id);" style="width: 5em; text-align: center ;font-weight:bold;color:red;border-style:solid;border-color:#07AC09;" title="vcgdbpDugas - Available Intensive Therapy Unit B(ITU B) - Y8qBmhmsqyj - (default) - int" value="[ Available Intensive Therapy Unit B(ITU B) (default) ]" /></td>
</tr>
<tr>
<td>
<div style="font-size: 14px; color: red;">
<strong>Intensive Therapy Unit C(ITU C)</strong></div>
</td>
<td style="text-align: center;">
<input id="Tpck07W8Eze-Y8qBmhmsqyj-val" onchange="oc_avb(this.id);" style="width: 5em; text-align: center ;font-weight:bold;color:red;border-style:solid;border-color:#07AC09;" title="Tpck07W8Eze - Available Intensive Therapy Unit C(ITU C) - Y8qBmhmsqyj - (default) - int" value="[ Available Intensive Therapy Unit C(ITU C) (default) ]" /></td>
</tr>
<tr>
<td>
<div style="font-size: 14px; color: red;">
<strong>Neonatal Intensive Care Unit (NICU)</strong></div>
</td>
<td style="text-align: center;">
<input id="hsRySAvLXBi-Y8qBmhmsqyj-val" onchange="oc_avb(this.id);" style="width: 5em; text-align: center ;font-weight:bold;color:red;border-style:solid;border-color:#07AC09;" title="hsRySAvLXBi - Available Neonatal Intensive Care Unit(NICU) - Y8qBmhmsqyj - (default) - int" value="[ Available Neonatal Intensive Care Unit(NICU) (default) ]" /></td>
</tr>
<tr>
<td>
<div style="font-size: 14px; color: red;">
<strong>Special Care Baby Unit(SCBU)</strong></div>
</td>
<td style="text-align: center;">
<input id="BG6u5O3arQ0-Y8qBmhmsqyj-val" onchange="oc_avb(this.id);" style="width: 5em; text-align: center ;font-weight:bold;color:red;border-style:solid;border-color:#07AC09;" title="BG6u5O3arQ0 - Available Special Care Baby Unit(SCBU) - Y8qBmhmsqyj - (default) - int" value="[ Available Special Care Baby Unit(SCBU) (default) ]" /></td>
</tr>
</tbody>
</table>
<p>
&nbsp;</p>

 Thanks
Barnali Banerjee


________________________________
 From: Lars Helge Øverland <larshelge@xxxxxxxxx>
To: easy <lin_xd@xxxxxxx> 
Cc: DHIS 2 developers <dhis2-devs@xxxxxxxxxxxxxxxxxxx> 
Sent: Friday, 23 August 2013 12:35 PM
Subject: Re: [Dhis2-devs] how to order in chart module?
 


Okay that makes sense to me.

I have written up a blueprint here:

https://blueprints.launchpad.net/dhis2/+spec/visualizer-chart-sort


Will try to get it in for 2.13 (2.14 if not).

Lars




On Sat, Aug 17, 2013 at 2:06 AM, easy <lin_xd@xxxxxxx> wrote:

Hi,sir,
>  Thanks,
>   for example, I want make a chart about patients number for a year and some organziations,  order  from high to low, if have multiple series, I can specify some serie to order.
>
>
>
>
>
>
>--
>
>此致
>
>easy
>
>莫愁前路无知己,天下谁人不识君。
>
>At 2013-08-16 17:52:59,"Lars Helge Øverland" <larshelge@xxxxxxxxx> wrote:
>
>Hi easy,
>>
>>
>>we don't support that at the moment. But it is a requirement request we get frequently. 
>>
>>
>>Can you explain a bit more detailed how you want the sorting to work? The tricky thing is to sort when you have multiple series and multiple categories - how would you like that to work?
>>
>>
>>Any others with views on this?
>>
>>
>>regards,
>>
>>
>>Lars
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>On Fri, Aug 16, 2013 at 2:30 AM, easy <lin_xd@xxxxxxx> wrote:
>>
>>Hi,sir,
>>>
>>>
>>>   I want to order the chart value, how to do ?
>>>
>>> Thanks.
>>>
>>>
>>>
>>>--
>>>
>>>此致
>>>
>>>  easy
>>>
>>>莫愁前路无知己,天下谁人不识君。
>>>
>>>
>>>_______________________________________________
>>>Mailing list: https://launchpad.net/~dhis2-devs
>>>Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>>Unsubscribe : https://launchpad.net/~dhis2-devs
>>>More help   : https://help.launchpad.net/ListHelp
>>>
>>>
>>
>
>

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp

References