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

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

sql server - SQL Query returns one result, does not return 0 or NULL result -