cancel
Showing results for 
Search instead for 
Did you mean: 

Remove Drag and Drop area for sap.m.upload.UploadSet control

parab_neha
Explorer
0 Kudos
721

Hello ,

In SAPUI5, for sap.m.upload.UploadSet , is it possible to remove Drag and Drop Area , (empty white area which says Drop files to upload, or use the "Upload" button) ? I want it to look like Fileuploader without the drag and drop.

UploadSet

Fileuploader

Thanks,

Neha

Accepted Solutions (0)

Answers (3)

Answers (3)

Tukutupap
Participant
0 Kudos

Hello,

The uploader has an aggregation that allows you custom define your uploader (sap.m.upload.UploadSet), which has an aggregation that lets you define drag and drop config (sap.ui.core.dnd.DragDropBase). There is a property "enabled" there, I guess you could try that?

In any case, remember you can always hide it using CSS.

Good luck!

shubham_c
Participant
0 Kudos

Hi Neha,

Try this,

this.getView().byId("UploadSet").addDelegate({
ondragenter: function (oEvent) {
oEvent.stopPropagation()
},
ondragover: function (oEvent) {
oEvent.stopPropagation()
},
ondrop: function (oEvent) {
oEvent.stopPropagation()
}
}, true);

Regards,

Shubham C

parab_neha
Explorer
0 Kudos

Thanks Shubham for your reply, I have already tried this. This stops user from drag and drop. But the white area with note " Drop files to upload, or use the "Upload" button" remains. I need solution to remove that area as well.

Thanks ,

Neha

shubham_c
Participant
0 Kudos

Hi Neha ,

 noDataText=" "    noDataDescription=" " 

set this two properties of upload set blank with space to remove the text for upload.

hope it will work for you.

Reagrds,

Shubham C

leonikussmaul
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Neha,

Did you already check the samples in the SDK? You can see both the UI and the code behind it there. There are a couple for the sap.m.UploadSet which don't seem to have this drag & drop area, so this should help you further.

https://sapui5.hana.ondemand.com/#/entity/sap.m.upload.UploadSet/sample/sap.m.sample.UploadSet

parab_neha
Explorer
0 Kudos

Thanks Leoni for your reply. But I have already checked the SDK. After removing attachment every sample uploader shows drag and drop ("No files found") area.