2つのテーブルがあり、行を任意のテーブルから別のテーブルにドラッグアンドドロップできるはずです。ドロップ中に、ドロップされた行の列の値を取得し、いくつかの列の値に加算と減算を行う必要があります。以下は私が試していることです(まだjQueryを学習しているので、コードが悪く見える場合はご容赦ください)。これに関する助けに感謝します。
ありがとう。
<script type = "text/javascript" >
$(function() {
$("#datepicker").datepicker();
});
$(function() {
setupDragDrop($('#t1 tr'), $('#t2 tr'));
setupDragDrop($('#t2 tr'), $('#t1 tr'));
});
function setupDragDrop(source, target) {
source.draggable({
revert: false,
opacity: .75,
containment: '.container',
cursor: 'move',
cursorAt: {
top: 35,
left: 45
},
helper: function(event) {
return $('<div class="drag-row"><table></table></div>').find('table').append($(event.target).closest('tr').clone()).end();
},
appendTo: 'body',
stop: function(event, ui) {
//this.drop();
}
});
target.droppable({
drop: function(event, ui) { //I tried many code here nothing works
},
accept: source.selector
});
}
$(function() {
$("[name=toggler]").click(function() {
$('.toHide').hide();
$("#blk-" + $(this).val()).show();
});
});
</script>