1
I own 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 one div to another div. Running 100%. However, I need to update the database, with the category I go through this new div. I need to recover by jQuery - cod_categoria and cod_negocio, and set this business in this new category, which was dragged...
The cod_negocio and cod_categoria in your code would be $negocios->neg_cod and $negocios->neg_nome?
– Julyano Felipe
Business code: neg_cod, category Cod (pipeline class) set_cod
– Sr. André Baill