TableBodyArea is a Div wrapped around TableBody 5. How to implement cell editing Dynamically insert a file in td when double-clicking td. This box is to give the innerHTML of td to the text box, when the text focus is lost. , assign the text box value to the innerHTML of td, and the code to remove the text box is as follows:
TableBody.find('td').live('dblclick',function(){ var td=$(this); if(td.attr('editable') =='true') { var text=td.text(); var html=""; td.html(html); td.addClass("tdediting"); // $(this).find('.TdEditTextBox' ).focus().focus().focus().focus(); $(this).find('.TdEditTextBox').blur(function(){ var val=$(this) .val(); td.html(val); td.removeClass("tdediting"); }); } });
6. How to sort: Due to time issues, please allow me to break it down next time! ! Source code download: /201007/yuanma/DataGrid.rar Author: houfeng Source: http://houfeng.cnblogs.com