选择文件并使用Angular拖放文件

发布于 2025-01-22 15:36:33 字数 1500 浏览 2 评论 0原文

在这里,我可以在选择时选择文件并在Kendo网格中显示。我想在网格中包括拖放和更新拖动文件。

这是我的HTML代码:

‹kendo-grid [data]="myFiles".    (remove)="removeHandler ($event)"
‹ng-template                   kendoGridToolbarTemplate      position="bottom" )

‹input type="file"               [disabled]="readonlyMode Il      readonlyVersion" (change)-   "uploadFile($event)" title="upload"    value-"Upload"/ >
 </ng-template›

 ‹kendo-grid-command-column     title="Remove" [width]="220"
 ‹ng-template kendoGridCellTemplate     field-"id" let-value>

 ‹button kendoGridRemoveCommand›<span    class="k-icon k-i-close k-icon-32"   (click)-"showconfirmpopup-true" ›</span>             </button>
 ‹kendo-   dialog*ngIf="showconfirmpopup==true">
   <div>Are you sure you want to remove this attachment?k/divf
    ‹div>
      «span›‹button kendoButton (click)-  "delete(value.id)" (click) -"showconfirmpopup-false"›Okay</button>          </span>
      «5pan>‹button kendoButton (click)-   "showconfirmpopup=false" ›Cancel</button>  </span>
     </div>
 </kendo-dialog›
</ng-template›
</kendo-grid-command-column>
«kendo-grid-column field-"name"   title-"Name"
 «/kendo-Grid-column&gt;
 
‹kendo-grid-command-column title-"Download" field-"file" [width]="220'
‹ng-template kendoGridCellTemplate                     ‹kendo-grid [data]="myFiles"

我正在附加UI的快照。

Here I’m able to select file and show it in kendo grid upon selection. I want to include drag and drop and update dragged file in the grid.

Here’s my html code:

‹kendo-grid [data]="myFiles".    (remove)="removeHandler ($event)"
‹ng-template                   kendoGridToolbarTemplate      position="bottom" )

‹input type="file"               [disabled]="readonlyMode Il      readonlyVersion" (change)-   "uploadFile($event)" title="upload"    value-"Upload"/ >
 </ng-template›

 ‹kendo-grid-command-column     title="Remove" [width]="220"
 ‹ng-template kendoGridCellTemplate     field-"id" let-value>

 ‹button kendoGridRemoveCommand›<span    class="k-icon k-i-close k-icon-32"   (click)-"showconfirmpopup-true" ›</span>             </button>
 ‹kendo-   dialog*ngIf="showconfirmpopup==true">
   <div>Are you sure you want to remove this attachment?k/divf
    ‹div>
      «span›‹button kendoButton (click)-  "delete(value.id)" (click) -"showconfirmpopup-false"›Okay</button>          </span>
      «5pan>‹button kendoButton (click)-   "showconfirmpopup=false" ›Cancel</button>  </span>
     </div>
 </kendo-dialog›
</ng-template›
</kendo-grid-command-column>
«kendo-grid-column field-"name"   title-"Name"
«/kendo-grid-column>
‹kendo-grid-command-column title-"Download" field-"file" [width]="220'
‹ng-template kendoGridCellTemplate                     ‹kendo-grid [data]="myFiles"

I’m attaching snapshot of ui hereui look when I choose a file

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文