Upload multiple files in custom edit template of CRUD not able to get data in backend.

2 posts, 0 answers
  1. vipul
    vipul avatar
    1 posts
    Member since:
    Sep 2016

    Posted 12 Oct Link to this post

    <script type="text/x-kendo-template" id="clientpaymentedittemp">

     <div id="surveySectionEditForm" class="k-popup-edit-form k-window-content k-content" data-role="window" tabindex="0" style="">
                <div class="container">
                    <div class="row">

                            <div class="k-edit-label">
                                <label for="ClientPayments_client_id">Client</label>
                            </div>
                            <div class="k-edit-field" data-container-for="ClientPayments_client_id">
                                <input required
                                       validationMessage="Is required"
                                       name="ClientPayments_client_id"
                                       data-bind="value:ClientPayments_client_id"
                                       data-value-field="value"
                                       data-text-field="text"
                                       data-source="ds_clients"
                                       data-option-label="Please choose"
                                       data-role="dropdownlist" />
                            </div>

                            <div class="k-edit-label">
                                <label for="ClientPayments_FileRecords_name">Files</label>
                            </div>

                            <div class="k-edit-field" data-container-for="ClientPayments_FileRecords_name">
                                <div class="k-edit-field k-button k-upload-button" aria-label="files" style="width:100%">
                                    <input name="files" id="files" type="file" data-role="upload" data-async='{"saveUrl":"http://dev.eqrcp.com/db/api/admin/client_payments.json", "autoUpload":"true"}'/>
                                    <!--<input class="k-input k-textbox" name="ClientPayments_FileRecords_name" id="files" type="file" data-role="upload" multiple="multiple" autocomplete="off" style="width:100%">-->
                                    <span>Files</span>
                                </div>
                            </div>



                            <div class="k-edit-label">
                                <label for="ClientPayments_amount">Amount</label>
                            </div>

                            <div class="k-edit-field" data-container-for="amount">
                                <input required validationMessage="Amount is required" type="number" class="k-input k-textbox" name="ClientPayments_amount" data-bind="value:ClientPayments_amount">
                            </div>
                    </div>
                </div>
            </div>
        </script>
        <script>
            $(document).ready(function() {
                    console.log("In files click");
                    $("").kendoUpload();
            });
        </script>

     

     

  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2156 posts

    Posted 13 Oct Link to this post

    Hello vipul,

    Have you configured the save handler on the backend that will receive the uploaded files? It is required, because the files will be submitted in a separate request, not the one with the rest of the form fields.

    Regards,
    Dimiter Madjarov
    Telerik by Progress
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
  3. Kendo UI is VS 2017 Ready
Back to Top