This is a migrated thread and some comments may be shown as answers.

TypeError: args.get_row is not a function

4 Answers 290 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Christophe
Top achievements
Rank 1
Christophe asked on 06 Mar 2014, 04:33 AM
Hi there,

I know this question has been asked thousands of time and I search for it in the forum but yet I could find anything to help me out.
As for many people, I'm trying to achieve such feature described here : Demo adding a custom field to an upload process.

Here is my (very simple) code :
01.<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="feature-data-upload.ascx.cs"
02.    Inherits="NRP.Study.usercontrols.feature_data_upload" %>
03.<telerik:RadScriptBlock ID="rsbDataUpload" runat="server">
04. 
05.    <script type="text/javascript">
06.        var $ = $telerik.$;
07. 
08.        function onClientFileUploaded(radAsyncUpload, args) {
09.            alert(1);
10.            var $row = $(args.get_row());
11.            var inputName = radAsyncUpload.getAdditionalFieldID("TextBox");
12.            var inputType = "text";
13.            var inputID = inputName;
14.            var input = createInput(inputType, inputID, inputName);
15.            var label = createLabel(inputID);
16.            $row.append("<br/>");
17.            $row.append(label);
18.            $row.append(input);
19.        }
20. 
21.        function createInput(inputType, inputID, inputName) {
22.            var input = '<input type="' + inputType + '" id="' + inputID + '" name="' + inputName + '" />';
23.            return input;
24.        }
25. 
26.        function createLabel(forArrt) {
27.            var label = '<label for=' + forArrt + '>File info: </label>';
28.            return label;
29.        }
30.        function startManualUpload() {
31.            var upload = $find('<%=rauDataUpload.ClientID%>');
32.            upload.startUpload();
33.        }
34.        function pauseManualUpload() {
35.            var upload = $find('<%=rauDataUpload.ClientID%>');
36.            upload.pauseUpload();
37.        }
38.        function resumeManualUpload() {
39.            var upload = $find('<%=rauDataUpload.ClientID%>');
40.            upload.resumeUpload();
41.        }
42.    </script>
43. 
44.</telerik:RadScriptBlock>
45.<telerik:RadProgressManager ID="rpmDataUpload" runat="server" />
46.<ul>
47.    <li>
48.        <input type="button" id="BtnStartUpload" onclick="startManualUpload()"
49.            value="Start" />
50.    </li>
51.    <li>
52.        <input type="button" id="BtnPauseUpload" onclick="pauseManualUpload()"
53.            value="Pause" />
54.    </li>
55.    <li>
56.        <input type="button" id="BtnResumeUpload" onclick="resumeManualUpload()"
57.            value="Resume" />
58.    </li>
59.    <li>
60.        <asp:Button ID="BtnSubmitFiles" runat="server" OnClick="BtnSubmitFiles_Clicked" Text="Submit" />
61.    </li>
62.</ul>
63.<telerik:RadAsyncUpload ID="rauDataUpload" runat="server" MultipleFileSelection="Automatic"
64.    ManualUpload="true" HttpHandlerUrl="~/Study/handlers/DataUploadManager.ashx"
65.    TemporaryFolder="~/App_Data/DataUploads" OnClientFilesUploaded="onClientFileUploaded">
66.</telerik:RadAsyncUpload>
67.<telerik:RadProgressArea ID="rpaDtatUpload" runat="server">
68.</telerik:RadProgressArea>

This is a usercontrol that I'm dynamically loading into my aspx page via a call to "LoadControl(xxxxx)".
The upload process looks good, everything works properly till it reaches that $(args.get_row()) on line #10.

Anyone has any idea why such "bug" ? Could this be due because I'm loading an external control from the page ?

Thanks,

Chris

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 Mar 2014, 09:00 AM
Hi Chris,

Try to attach OnClientFileUploaded event of the RadASyncUpload which works fine at my end.

ASPX:
<telerik:RadAsyncUpload ID="rauDataUpload" runat="server" MultipleFileSelection="Automatic"
    OnClientFileUploaded="onClientFileUploaded" ManualUpload="true">
</telerik:RadAsyncUpload>

Thanks,
Shinu.
0
Christophe
Top achievements
Rank 1
answered on 06 Mar 2014, 11:10 AM
Hi Shinu,

Thanks for your reply but as you can see in my code on line #8 and #65 i'm already doing what you are suggesting. And it works fine, my js handler is called as the alert(1) is executed.
It then fails on args.get_row()

Any thoughts ?

Cheers
0
Shinu
Top achievements
Rank 2
answered on 07 Mar 2014, 03:16 AM
Hi Chris,

In your code (Line No 65) you are trying to attach the 'OnClientFilesUploaded' event of RadAsyncUpload. Instead of that try to attach the OnClientFileUploaded  event of RadAsyncUpload which works fine at my end.To add custom fields to the uploaded files, use the OnClientFileUploaded client-side event. Please have a look into this help documentation for further information.
 
Thanks,
Shinu.
0
Christophe
Top achievements
Rank 1
answered on 07 Mar 2014, 05:40 AM
Hell you are right. Thanks for your help, i'll try this asap
Hopefully everything will be ok then.

Cheers.

Chris
Tags
AsyncUpload
Asked by
Christophe
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Christophe
Top achievements
Rank 1
Share this question
or