Dragging and dropping

MiServer is Dyalog's APL-based web development framework

Dragging and dropping

Postby StephenTaylor on Tue Mar 18, 2014 10:01 pm

I have multiple drop targets, and need to identify the element that triggered the call to APLJax.

It looks as if I should be able to read its ID from declared public field what as illustrated in jqondemo.dyalog. I can certainly read its sibling field event. But trying to read what yields a value error. The MiServer manual says (p59) that what will be set for #.JQ.On callbacks if the element triggering the event has an ID set. Inspecting it in Chrome's developer tools shows:

Code: Select all
...
<tr id="player2" class="ui-droppable">
  <td>Dick Cobley</td>
  <td>0</td>
</tr>
...

confirming the TR is the drop target and has an ID. Is nesting a problem? Recoded to make the 1st-column TDs the drop targets, confirming classes and IDs as above, but still no what.

I have assumed here that #.JQUI.Droppable is built on #.JQ.On and so I can rely on event and what. If not, should I simply roll my own using #.JQ.On?
Attachments
scoreboard.dyalog
(1.52 KiB) Downloaded 1083 times
User avatar
StephenTaylor
 
Posts: 31
Joined: Thu May 28, 2009 8:20 am

Re: Dragging and dropping

Postby StephenTaylor on Wed Mar 19, 2014 11:38 pm

Update: the required ID is found by
      req.GetData 'receiver'
User avatar
StephenTaylor
 
Posts: 31
Joined: Thu May 28, 2009 8:20 am

Re: Dragging and dropping

Postby Brian|Dyalog on Thu Mar 20, 2014 12:58 am

Right, we wrote JQUI.Droppable to return two ids - "receiver" has the id of the container that was dropped upon, and "drag" has the id for the item that was dragged and dropped.
User avatar
Brian|Dyalog
 
Posts: 120
Joined: Thu Nov 26, 2009 4:02 pm
Location: West Henrietta, NY


Return to MiServer

Who is online

Users browsing this forum: No registered users and 1 guest