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

Clear added items of active upload control

2 Answers 116 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Linh Hoang
Top achievements
Rank 1
Linh Hoang asked on 06 Jul 2015, 04:51 AM

I have been following this thread (http://www.telerik.com/forums/radasyncupload-clear-items-using-serverside-code) for a similar issue.

Issue: "I am using RadAsyncUpload to upload files. I have a 'Cancel' button which the user can click anytime after selecting the files. I want to clear the selected files - or in other words reset the RadAsyncUpload Control when 'Cancel' button is clicked." (by Liby George)

Solution: Please include the following line of code in your click handler for the "Cancel" button.
//JavaScript
$telerik.$(".ruInputs li .ruRemove").click()
This will go through the files <li> elements and click on the "Remove" link.  (by Boyan Dimitrov)

My problem: Since there are severals RadAsyncUpload along with coresponding buttons in one page, this will clear all selected files of all upload controls for a single click . How can I clear the items of one RadAsyncUpload without affecting the others?

2 Answers, 1 is accepted

Sort by
0
Linh Hoang
Top achievements
Rank 1
answered on 07 Jul 2015, 01:39 AM

I have been stuck in this issue. Could anyone advice me please?

How can I clear the items of one RadAsyncUpload (server side / client side) without affecting the others?

Thanks a lot for any suggestion.

0
Hristo Valyavicharski
Telerik team
answered on 08 Jul 2015, 02:29 PM
Hi Linh,

Try this:

function removeFile(fileName) {
    $('.ruUploadProgress.ruUploadSuccess:contains('+ fileName + ')').parent().next().click();
}


Regards,
Hristo Valyavicharski
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
AsyncUpload
Asked by
Linh Hoang
Top achievements
Rank 1
Answers by
Linh Hoang
Top achievements
Rank 1
Hristo Valyavicharski
Telerik team
Share this question
or