Sending form tho Ajax
[order_line_extra.git] / item_schedule.php
index e5115b12014ff883f6d0b74a2e678cbea11ad973..8fb4247993b8c33589b038d0cf3df6a5462ad9bf 100644 (file)
@@ -128,15 +128,16 @@ tr.tDnD_whileDrag :nth-child(4), tr.tDnD_whileDrag :nth-child(5) {
                console.log(row)
        }
        function onDrop(table, row) {
-                       console.log(table)
-                       console.log(row)
+               var row_ids = $.map(table.tBodies[0].rows, function(r) { return r.id} )
+               var row_id = row.id
+               var form = $(table).closest('form')[0]
+               JsHttpRequest.request(this, form);
+               
        }
 
        var inserts = {
                '#item_schedule table': function (e) { 
-                       // We can't use e directly because we need a JQUery Object to call tableDnD
-
-                       $('#item_schedule table').tableDnD({onDragStart: onDragStart, onDrop: onDrop})
+                       $(e).tableDnD({onDragStart: onDragStart, onDrop: onDrop})
                }
        }
 Behaviour.register(inserts);