How to customise delete operation?

4 posts, 0 answers
  1. Tayger
    Tayger avatar
    191 posts
    Member since:
    Jan 2015

    Posted 23 Apr 2017 Link to this post

    Hello 

    I checked the remove functions of the Upload Widget. As far as I understand: Any remove functionality reacts only on files "inside" the Upload widget. The widget itself is not persistent: You can upload files by the widget to get files into that list. You then can delete/remove them right away. After reload the page this file list is empty. The usual business case I know is: Customer do upload files on a day and want to delete it any other day or just later. I have such a case and create a unique ID for each uploaded file. I wonder if and how it is possible to use the Upload widget by sending this ID and triggering the removeURL handler. I've found some very old entries, one with trigger the remove event by "$(".k-delete").parent().click();" but nothing happens doing that. 

    The most simple way would be to add a file to be deleted on that file list and then call the removeURL handler. 

    Is there an easy way to do that or is it better to use a separate AJAX call?

    Regards

  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    2062 posts

    Posted 24 Apr 2017 Link to this post

    Hello,

    If async mode is enabled there is a way to programmatically pre-populate the Upload's file list. See the files configuration option for more details and an example.

    Regards,
    Ivan Danchev
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Tayger
    Tayger avatar
    191 posts
    Member since:
    Jan 2015

    Posted 24 Apr 2017 in reply to Ivan Danchev Link to this post

    Hi Ivan

    Thank you for the link. Ummm, based on the documentation the Upload Widget would then upload the files in the list (start the uploadURL handler). In my case I would like to to call the removeURL handler. How do I do that or how does the Upload handler know it has to call the remove handler?

  4. Ivan Danchev
    Admin
    Ivan Danchev avatar
    2062 posts

    Posted 26 Apr 2017 Link to this post

    Hi,

    The saveUrl handler is not called when using the files option. The files are just rendered in the list and will look as uploaded, but are not actually uploaded. As for calling the removeUrl handler, clicking on the x button will do that. Another way to trigger the remove handler programmatically is by calling the removeFileByUid method.

    Regards,
    Ivan Danchev
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top