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

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

1 Answer 27 Views
Upload
This is a migrated thread and some comments may be shown as answers.
vipul
Top achievements
Rank 1
vipul asked on 12 Oct 2016, 12:25 PM

<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>

 

 

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 13 Oct 2016, 07:33 AM

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.
 
Tags
Upload
Asked by
vipul
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or