I've written a client-side javascript method to handle the OnClientProgressUpdating event for my ProgressArea. The signature looks as follows:
function progressUpdating(progressArea, args) {
alert(args.get_progressData().RadUpload.RequestSize);
However, I can't seem to get any information for the "RadUpload" object. When I inspect the "args" object using the debugger, here is what it contains:
? args.get_progressData()
{...}
CurrentOperationText: "Uploaded SendACHFile.txt"
InProgress: true
PrimaryPercent: "1"
PrimaryTotal: "588480"
PrimaryValue: "8192"
ProgressCounters: true
SecondaryPercent: "1"
SecondaryTotal: "588480"
SecondaryValue: "8192"
TimeElapsed: "00:00:01s"
Where is the RadUpload object? This does not match the documentation. There are supposed to be additional properties. How can I get access to the "RadUpload" object?
The above code throws the following exception:
Microsoft JScript runtime error: 'get_progressData().RadUpload.RequestSize' is null or not an object
6 Answers, 1 is accepted
The OnClientProgressUpdating client event fires for both the ProgressArea and the ProgressManager. The event arguments have different methods depending on which is the sender. Please subscribe to the OnClientProgressUpdating event of the progress manager to get that properties working.
Kind regards,
Veselin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
<telerik:RadProgressArea ID="RadProgressArea1" runat="server" DisplayCancelButton="False"
OnClientProgressUpdating="progressUpdating" ProgressIndicators="TotalProgressBar, TotalProgress, TotalProgressPercent, RequestSize, FilesCountBar, FilesCount, FilesCountPercent, SelectedFilesCount, TimeElapsed, TimeEstimated">
and the javascript method is as follows:
<script type="text/javascript">
function progressUpdating(progressArea, args) {
alert(args.get_progressData().RadUpload.RequestSize);
As previously stated, the "RadUpload" property does not exist. Please advise.
Thanks
Is there a way to extend the progressArea class such that I can add my own custom properties to it?
You can add your custom properties to the progress area the following way:
<script type="text/javascript"> |
Telerik.Web.UI.RadProgressArea.prototype.ob = new Object(); |
Telerik.Web.UI.RadProgressArea.prototype.ob.a = 5; |
</script> |
and then use the added property like this:
<script type="text/javascript"> |
function progressUpdating(sender, args) { |
alert(sender.ob.a); |
} |
</script> |
I hope this help you get started.
Regards,
Genady Sergeev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
If I have understood you correctly, you want to script a client side property from the ServerSide. Is that correct? You can do that in the following way:
StringBuilder sb =
new
StringBuilder();
sb.Append(
"Telerik.Web.UI.RadProgressArea.prototype.ob = new Object();"
);
sb.Append(
"Telerik.Web.UI.RadProgressArea.prototype.ob.a = 5;"
);
ClientScript.RegisterStartupScript(
this
.GetType(),
"Page_Load"
, sb.ToString(),
true
);
This is very trivial example, however you can register whatever you want, even complex object serialized using JSON.
Kind regards,
Genady Sergeev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.