bootstrap table当前行 上移 下移

var operateEvents = {
	    'click .up': function (e, value, row, index) {
      		//点击上移
      		var $tr = $(this).parents("tr"); 
	        if ($tr.index() == 0||$tr.index() == 1){
	        	alert("首行数据不可上移");
	        }else{
	            $tr.fadeOut().fadeIn(); 
	            $tr.prev().before($tr); 
	        } 
	        //下移
	        /*var $tr = $(this).parents("tr"); 
	        if ($tr.index() != len - 1) { 
	            $tr.fadeOut().fadeIn(); 
	            $tr.next().after($tr); 
	        } */
	    }
    };

你可能感兴趣的:(js)