TypeError: args.get_row is not a function

5 posts, 0 answers
  1. Chris
    Chris avatar
    58 posts
    Member since:
    Feb 2012

    Posted 05 Mar 2014 Link to this post

    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

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 Mar 2014 in reply to Chris Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Chris
    Chris avatar
    58 posts
    Member since:
    Feb 2012

    Posted 06 Mar 2014 in reply to Shinu Link to this post

    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
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 Mar 2014 in reply to Chris Link to this post

    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.
  6. Chris
    Chris avatar
    58 posts
    Member since:
    Feb 2012

    Posted 06 Mar 2014 in reply to Shinu Link to this post

    Hell you are right. Thanks for your help, i'll try this asap
    Hopefully everything will be ok then.

    Cheers.

    Chris
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017