I am using Jquery to making drag and drop.
My short javascript to make an item to drag is:
$(".draggable").draggable();
My short javascript to make a dropable area is:
$("#droppable").droppable();
Here is my dragable item short HTML code:
<div id="comItem[]" class="computerItem draggable">
<img src="img/com.png" class="assetImg" alt="Computer Info" title="">
<span id="owner[]" class="textLabel"></span>
<span id="ipaddress[]" class="textLabel"></span>
</div>
Does someone know how to get the values from dropped items in dropable area? I want to create the object array form the dropped items?
Thank you so much.
You can use the ui.draggable
object in drop
action
$( "#droppable" ).droppable({
drop: function( event, ui ) {
$(this).append($(ui.draggable).find('img'));
}
})
Here ui.draggable
is the element which you have dropped. (in this case the whole div)
I'm trying to wrap my head around Meteor's reactivity. I understand it re-renders a page when a reactive data source that's being referenced in a template changes. I also understand what constitutes a ...
I'm trying to wrap my head around Meteor's reactivity. I understand it re-renders a page when a reactive data source that's being referenced in a template changes. I also understand what constitutes a ...
I wrote this test code just to check if Angular is working with Jade. layout.jade doctype html html head title #{title} link(rel='stylesheet', href='/stylesheets/style.css') body(ng-app='...
I wrote this test code just to check if Angular is working with Jade. layout.jade doctype html html head title #{title} link(rel='stylesheet', href='/stylesheets/style.css') body(ng-app='...
This is something I fear has been answered before, but I couldn't find anything. I am working on a modest web application. Part of it is a file-uploader which uploads xml-files to a Java servlet, ...
This is something I fear has been answered before, but I couldn't find anything. I am working on a modest web application. Part of it is a file-uploader which uploads xml-files to a Java servlet, ...
I'd like to have the colour selected from a Primefaces ColourPicker sent to my backend on change. This seems not to be supported though. <p:colorPicker value="#{colorView.colorPopup}" /> I ...
I'd like to have the colour selected from a Primefaces ColourPicker sent to my backend on change. This seems not to be supported though. <p:colorPicker value="#{colorView.colorPopup}" /> I ...