DevExtreme-具有FileUpload的单元

问题描述

是否有可能创建具有与行关联的FileUpload的DataGrid单元。

例如,我有包含记录的数据库,并且希望有可能将文件附加到选定的记录。

有人知道该怎么做并可以与我分享;)

非常感谢您的帮助:D

解决方法

您的意思是这样的吗?

一个简单的演示

<div class="demo-container">
    <div id="gridContainer"></div>
</div>


<script>
    $(function () {
        var customers = [{
            "ID": 1,"CompanyName": "Premier Buy","Address": "7601 Penn Avenue South",},{
            "ID": 2,"CompanyName": "ElectrixMax","Address": "263 Shuman Blvd",{
            "ID": 3,"CompanyName": "Video Emporium","Address": "1201 Elm Street",}]
        $("#gridContainer").dxDataGrid({
            dataSource: customers,showBorders: true,columns: ["CompanyName","Address",{
                dataField: "COLUNIQID",alignment: 'center',caption: "Actions",cellTemplate: function (container,options) {
                    $('<input type="file" />')
                        .on('change',function () {
                            //do the upload here
                            
                        })  
                        .appendTo(container);
                }
            }]
        });

    });
</script>

enter image description here