D
dchillman
I have a user control page (ascx) that contains a third-party spreasheet
control. When the user clicks the insert button on the spreadsheet control,
I am trying to pre-insert values into the new row. If I put the spreadsheet
control directly on as aspx page, I can do this in the window.onload
function. However, when the spreadsheet control in on an ascx page, I get an
error that says the control is undefined.
here is the code on the html page of the ascx.
<script language="javascript">
function window.onload()
{
//debugger
var i;
//var spreadRef = document.getElementById(FpSread1);
var table = FpSread1.all("FpSpread1_viewPort").firstChild;
for(i=1;i<=spreadRef.GetRowCount();i++)
{
if(table.rows.FpKey=="newRow")
{
alert("New Row");
FpSread1.SetValue(i-1, 0, FpSread1.GetValue(i, 0));
FpSread1.SetValue(i-1, 1, FpSread1.GetValue(i, 1));
FpSread1.SetValue(i-1, 2, FpSread1.GetValue(i, 2));
}
}
}
</script>
When the page loads, there is a yellow exclamation point that essentially
states that
"FpSpread1 is undefined".
Is it possible to access a third party control within a user control on the
clientside?
Thanks for any help you can provide.
control. When the user clicks the insert button on the spreadsheet control,
I am trying to pre-insert values into the new row. If I put the spreadsheet
control directly on as aspx page, I can do this in the window.onload
function. However, when the spreadsheet control in on an ascx page, I get an
error that says the control is undefined.
here is the code on the html page of the ascx.
<script language="javascript">
function window.onload()
{
//debugger
var i;
//var spreadRef = document.getElementById(FpSread1);
var table = FpSread1.all("FpSpread1_viewPort").firstChild;
for(i=1;i<=spreadRef.GetRowCount();i++)
{
if(table.rows.FpKey=="newRow")
{
alert("New Row");
FpSread1.SetValue(i-1, 0, FpSread1.GetValue(i, 0));
FpSread1.SetValue(i-1, 1, FpSread1.GetValue(i, 1));
FpSread1.SetValue(i-1, 2, FpSread1.GetValue(i, 2));
}
}
}
</script>
When the page loads, there is a yellow exclamation point that essentially
states that
"FpSpread1 is undefined".
Is it possible to access a third party control within a user control on the
clientside?
Thanks for any help you can provide.