I have a table with Up and Down button in all the rows and i want to move rows onclick of up/down in respective directions in table. I am able to do it but the issue is i have a style sheet for alternate rows which i do not want to move along with row movement. But current function move css also which looks very wearied on the page. Can someone please let me know how can i stop moving CSS. My code is below –
$(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());
}
});
});
I have to check if moving row has come css then it should be stripped and assigned to new row.
wondering if this seem a bit acceptable