No announcement yet.
  • Filter
  • Time
Clear All
new posts

  • Best practice needed: Easier file upload via Drag & Drop

    Hi Isomorphic,

    is there some way to implement Drag and Drop fileupload with current FormItems (perhaps CanvasItem?).
    We have a customer request for this "that it works like in GMail":

    Click image for larger version

Name:	FileUploadGmail.png
Views:	1
Size:	36.5 KB
ID:	254876

    I know that you can drop a file on the browser's native (native because of the "Datei auswählen" String on German, even though the showcase is loaded in English) FileItem:
    Click image for larger version

Name:	NativeFileItem.PNG
Views:	1
Size:	4.6 KB
ID:	254877

    But this is not modern enough here and a normal filedrop somewhere on the GUI in the Showcase just results in Chrome 68 opening the .txt-file.

    12.1d Canvas does not have a "addFileDropHandler or similar". addDropHandler() seems to be related to SmartGWT internal DnD only.

    If this is not possible yet, could you consider it as potential enhancement?

    Thank you & Best regards

  • #2
    Currently the way you would need to do this is to put some HTML elements in the innerHTML of a Canvas and add your own JS logic to work with native APIs for file drag and drop. It's relatively straightforward, although of course you will run into browser bugs.

    This is something we've definitely thought about wrapping up in a set of SmartGWT APIs so no native code is required, and that would be a valid Feature Sponsorship if you're interested.


    • #3
      Hi Isomorphic,

      thanks. It's got to know that you consider this yourself and that it would be possible as Feature Sponsorship.
      I'll wait for other customer complaints / requests and perhaps get back to you.

      Best regards