I have the following jQuery
$(function() {
$( "#sortable1, #sortable2, #sortable3, #sortable4, #sortable5, #sortable6").sortable({
connectWith: ".connectedSortable",
receive: function( event, ui ){
jQuery("#carregando").html('<div class="text-center"><span class="fa fa-spin fa-spinner"></span> carregando..</div>').delay(2000).fadeOut("slow");
setTimeout(function(){
$.ajax({
url: '<? echo base_url("vendas/pipeline/ajax"); ?>',
success: function(data) {
$('.pipeline').html(data);
}
});
}, 2000);
},
}).disableSelection();
});
And the following HTML with PHP
<div class="pipeline" id="pipeline">
<? $i=1; foreach($lista_negocios_dashboard as $valor){ ?>
<div class="col-md-2 pipeline-base connectedSortable" id="sortable<?=$i;?>">
<div class="pipeline-categoria text-right">
<? echo $valor->set_setor; ?>
</div>
<? foreach($valor->negocios as $negocios){ ?>
<div class="pipeline-negocio">
<h5><a href="<? echo base_url()."vendas/pipeline/negocios/editar/".$negocios->neg_cod; ?>"><? echo $negocios->neg_nome; ?></a></h5>
<p><? echo $negocios->neg_descricao; ?></p>
</div>
<? } ?>
</div>
<? $i++;} ?>
</div>
In this, I can move a div to another div. Working 100%. However, I need to update the database, with the category I pass through this new div. I need to retrieve by jQuery - cod_category and cod_business, and set this business in this new category, which was dragged ...