Languages

Menu
Sites
Language
Drag and Drop is not working in Tizen Device

Hi all,

I am trying to implement Drag and Drop functionlaity for my app.When I tried some sample code, it is working fine in the web simulator(chrome), but it is not working in tizen device and emulator.when ever i long press it , i am getting an context popup option as drag and drop.But my requirement is ,I dont need a context pop up for drag and drop instead it has to drag. Please let me know how to do that?

Sample code used :

<!DOCTYPE HTML>
<html>
<head>
<style>
#div1 {width:350px;height:70px;padding:10px;border:1px solid #aaaaaa;}
</style>
<script>
function allowDrop(ev) {
    ev.preventDefault();
}

function drag(ev) {
    ev.dataTransfer.setData("text", ev.target.id);
}

function drop(ev) {
    ev.preventDefault();
    var data = ev.dataTransfer.getData("text");
    ev.target.appendChild(document.getElementById(data));
}
</script>
</head>
<body>

<p>Drag the W3Schools image into the rectangle:</p>

<div id="div1" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
<br>
<img id="drag1" src="img_logo.gif" draggable="true" ondragstart="drag(event)" width="336" height="69">

</body>
</html>

 

Thanks in advance.

Sampath

 

Responses

7 Replies
Marco Buettner

do your disable context menu on config.xml?

Sampath Arunachalam

Thanks for your Reply.

Yes. I checked by disabling the context menu. After doing that, nothing happens...

AVSukhov

Hello,

Tutorial about using Drag and Drop on Tizen Web app:

https://developer.tizen.org/documentation/tutorials/web-application/w3chtml5supplementary-features/ui/html5-drag-and-drop

Sampath Arunachalam

Dear AVSukho,

Thanks for your reply.

I have tried the sample given in this tutorial also. This example works fine in chrome,but whenever i tried the same in the emulator, a context popup appears first and then aftetr selecting it , drag and drop is happening. If I disable the context popup nothing is happening. But My Requirement is , I dont want the context popup option for drag and drop.

AVSukhov

Hello,

According documentation you cannot use Drag nad Drop with aout context menu:

"To use drag and drop in a Tizen device, long-press the draggable element. When the context menu appears, select the Drag menu."

Sampath Arunachalam

HI, Thanks for the reply.

Is it possible to report this as a bug or is there any way i can request this support?

AVSukhov

Hello,

You can try submitt ticket to:

https://bugs.tizen.org

You can login with your forum account.