datalist - data list move up and down rows jquery -


hi trying move data , down data list, here fiddle tried not getting required one. can 1 me

https://jsfiddle.net/mwd4ranu/

$(document).ready(function(){ $(".up,.down").click(function(){     var row = $(this).parents("tr:first");     if ($(this).is(".up")) {         row.insertbefore(row.prev());     } else {         row.insertafter(row.next());     } }); 

});

when use parents("tr:first") select closest tr , not 1 try move

$(document).ready(function(){   $(".up,.down").click(function(){     var row = $(this).parents("#dllist > tbody > tr").first();     if ($(this).is(".up")) {         row.insertbefore(row.prev());     } else {         row.insertafter(row.next());     }   }); }); 

ps : not forget select jquery fiddle javascript library


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -