$(function(){
//隔行換色
// $("tbody tr:odd").css("background-color","#eee");
var numId = $(".tbody td");
numId.dblclick(function(){
var tdIns = $(this);
var tdpar = $(this).parents("tr");
//tdpar.remove();
//current_record = tdpar;
tdpar.css("background-color","yellow");
//lineclick(tdpar);
//alert(tdpar.children("td").val());
if ( tdIns.children("input").length>0 ){ return false; }
var inputIns = $(""); //需要插入的輸入框代碼
var text = $(this).html();
inputIns.width(tdIns.width()); //設置input與td寬度一致
inputIns.val(tdIns.html()); //將本來單元格td內容copy到插入的文本框input中
tdIns.html(""); //刪除原來單元格td內容
inputIns.appendTo(tdIns).focus().select(); //將需要插入的輸入框代碼插入dom節點中
inputIns.click(function(){ return false;});
//處理Enter和Esc事件
inputIns.blur(function(){
var inputText = $(this).val();
tdIns.html(inputText);
tdpar.css("background-color","white");
// tdIns.html(text);
});
});
});