Add more log on tableDnD

This commit is contained in:
Laurent Destailleur 2017-03-24 23:52:06 +01:00
parent d1a988a0be
commit 6b33a755ba

View File

@ -44,6 +44,7 @@ $(document).ready(function(){
$("#<?php echo $tagidfortablednd; ?>").tableDnD({ $("#<?php echo $tagidfortablednd; ?>").tableDnD({
onDrop: function(table, row) { onDrop: function(table, row) {
var reloadpage = "<?php echo $forcereloadpage; ?>"; var reloadpage = "<?php echo $forcereloadpage; ?>";
console.log("tableDND onDrop");
console.log($("#<?php echo $tagidfortablednd; ?>").tableDnDSerialize()); console.log($("#<?php echo $tagidfortablednd; ?>").tableDnDSerialize());
var roworder = cleanSerialize($("#<?php echo $tagidfortablednd; ?>").tableDnDSerialize()); var roworder = cleanSerialize($("#<?php echo $tagidfortablednd; ?>").tableDnDSerialize());
var table_element_line = "<?php echo $table_element_line; ?>"; var table_element_line = "<?php echo $table_element_line; ?>";
@ -59,14 +60,15 @@ $(document).ready(function(){
filepath: filepath filepath: filepath
}, },
function() { function() {
console.log("tableDND end of ajax call");
if (reloadpage == 1) { if (reloadpage == 1) {
location.href = '<?php echo $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']; ?>'; location.href = '<?php echo $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']; ?>';
} else { } else {
$("#<?php echo $tagidfortablednd; ?> .drag").each( $("#<?php echo $tagidfortablednd; ?> .drag").each(
function( intIndex ) { function( intIndex ) {
$(this).removeClass("pair impair"); // $(this).removeClass("pair impair");
if (intIndex % 2 == 0) $(this).addClass('impair'); //if (intIndex % 2 == 0) $(this).addClass('impair');
if (intIndex % 2 == 1) $(this).addClass('pair'); //if (intIndex % 2 == 1) $(this).addClass('pair');
}); });
} }
}); });