1 $(document).ready( function() {
3 var cell_blur = function() {
4 console.debug( 'cell_blur'
8 var content = $(this).val();
9 var cell = $('<td>'+content+'</td>');
10 $(this).replaceWith( cell );
14 var cell_click = function(event) {
15 console.debug( 'cell_click'
20 var content = $(this).text(); // we don't want para markup
21 var textarea = $('<textarea />');
22 textarea.val( content );
23 $(this).html( textarea );
25 textarea.blur( cell_blur )
29 console.info('double-click on cell to edit it');
30 $('table td').live( 'dblclick', cell_click );