From acf3d7ed8523c68c45f094254842e828b4f27090 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sun, 23 May 2010 17:23:17 +0200 Subject: [PATCH 1/1] hard-coded primary key on first column --- public/edit_table.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/public/edit_table.js b/public/edit_table.js index 11c3f2f..73404fe 100644 --- a/public/edit_table.js +++ b/public/edit_table.js @@ -2,10 +2,14 @@ $(document).ready( function() { var cell_blur = function() { console.debug( 'cell_blur' - , this - , $(this).val() +// , this +// , $(this).val() ); + // FIXME primary key is fixed to 1st column + var pk = $('table tr th:nth(0) > a').text(); + var id = $(this).parent().siblings(':nth(0)').text() + var x = $(this).parent().attr('cellIndex'); var y = $(this).parent().parent().attr('rowIndex'); @@ -19,7 +23,7 @@ var cell_blur = function() { $(this).replaceWith( content ); var name = $('table tr th:nth('+x+') > a').text(); - console.info( x, y, name, content ); + console.info( x, y, pk, id, name, content ); } var cell_click = function(event) { -- 2.20.1