cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Unable to update chart after onchange event

Former Member
0 Likes
196

I have an OnChange event from my irpt containing a drop down box and an iSPCChart. I would like to have it when the user selects a number from the drop down list it passes the param and then refreshes the chart. I know everything works on this except my update grid code because I click the refresh on the chart footer and the chart reflects what the user selects. Can you please review this and let me know what I need to do to fix this?



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>

<!--
Owner	Gregory M. Pyles Jr.
Phone	x2689
Date	02/21/2007

Brief Description:
		
		This view allows users to see 6 mos worth of SK_FinalWeight data as an 
		Ind Chart.  They have the ability to change the record count to see 
		variability in Control Limits.  
-->

        <title>SK_FinalWeights_Ind</title>
        <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
        <meta http-equiv="Expires" content="0" />
        <meta http-equiv="Cache-Control" content="no-cache" />
        <meta http-equiv="Pragma" content="no-cache" />

		<script type="text/javascript">
/*	
where		tblSelection.Select List
applet		ind_SK_FinalWeights
type		onChange
class		n/a
method		onChange

Comments	Ignores "-- Select --" and selects the value from the dropdown list.  
			Then sets the param.5 (Fix Query: Select TOP [Param.5] ...From ...Where).
			Updates the grid to reflect value selected.

Examples	(1) alert(eval(obj<i>.value))
			(2) alert(df.RecordCount.value)
*/	
			 function doSel(obj)
			 {
					 var df = document.frmMain;
											 
					 for (i = 1; i < obj.length; i++) 
					 {
							 if (obj<i>.selected == true) 
							 {
									 document.ind_SK_FinalWeights.getQueryObject().setParam(5,df.RecordCount.value);
//-----------------------------------------------------------------------------------------
									 document.ind_SK_FinalWeights.updateGrid(true);
//------------------------>  Problem is on above line  <-----------------------------------
							 }
					 }
			}
		</script>

    </head>
    <body>

<!--		This body consist of two tables one of which is embedded in the first table.  "tblMain" sets the perimeter of the body.  
				(1) The first row contains tblSelection drop down lists or ibrowsers can be placed here.  
				(2) The second row contains the iSPCChart.
-->

		<form name="frmMain">
			<table name="tblMain" border="5">
				<tr>
					<table name="tblSelection" border="0">
					<td>Record Count</td>
						<td>
							<select name="RecordCount" onchange="doSel(this)">
								<option> -- Select --</option>
								<option value="10">10</option>
								<option value="25">25</option>
								<option value="50" selected="selected">50</option>
								<option value="75">75</option>
								<option value="100">100</option>
								<option value="150">150</option>
								<option value="250">250</option>
								<option value="500">500</option>
							</select>
						</td>
					</table>
				</tr>
				<tr>
					<td>
						<applet name="ind_SK_FinalWeights" codebase="/Illuminator/Classes" code="iSPCChart" archive="illum8.zip" width="775" height="480" mayscript>
						<param name="DisplayTemplate" value="LincolnElectric/Dev/SK/dspSK_FinalWeights_Ind">
						<param name="QueryTemplate" value="LincolnElectric/Dev/SK/qrySK_FinalWeights_IndChart">
						<param name="ShowVerticalGrid" value="false">
						<param name="InitialUpdate" value="true">
						<param name="Param.1" value="{ID}">
						<param name="Param.2" value="{Line}">
						<param name="Param.3" value="{Operator}">
						<param name="Param.4" value="{OrderNo}">
						<param name="Param.5" value="50">
						</applet>
					</td>
				</tr>
			</table>
		</form>
    </body>
</html>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

You have an iSPCChart applet, but are using the iGrid's updateGrid(true) method. Try changing the updateGrid(true) to updateChart(true). That should work for you.

Answers (0)