From 046be716a4814a03e139b990543831e5e30d2a34 Mon Sep 17 00:00:00 2001 From: Maxime Bourget Date: Fri, 31 May 2013 18:31:04 +0100 Subject: [PATCH] rows have an id. --- haxe/ItemScheduler.hx | 8 +++++--- item_schedule.php | 9 ++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/haxe/ItemScheduler.hx b/haxe/ItemScheduler.hx index a015cc4..b86ab86 100644 --- a/haxe/ItemScheduler.hx +++ b/haxe/ItemScheduler.hx @@ -116,16 +116,18 @@ class ItemScheduler { function printRow(tds : Array, attributes : Array) { php.Lib.print(''); + var position : Int = 1; for(td in tds) { - php.Lib.print(''); + php.Lib.print(''); if(td) php.Lib.print(td); php.Lib.print(''); + position++; } php.Lib.print(''); } function formatOrder(order : Dynamic, left : Int, date : Date) { - var attributes = []; + var attributes = ['id = "order_'+order.id+'"']; var classes = []; var before : Int = left + order.quantity; /* We have basically 3 different cases; @@ -213,7 +215,7 @@ class ItemScheduler { ,"" ]; - printRow(cells, ['class = "tableheader location"']); + printRow(cells, ['class = "tableheader location"', 'id = "loc_'+location.code+'"']); } /* diff --git a/item_schedule.php b/item_schedule.php index fff2d21..04c7b4b 100644 --- a/item_schedule.php +++ b/item_schedule.php @@ -114,7 +114,14 @@ tr.tDnD_whileDrag :nth-child(4), tr.tDnD_whileDrag :nth-child(5) { console.log('hello') $(document).ready(function() { console.log('ready') - $('#item_schedule table').tableDnD() + $('#item_schedule table').tableDnD({ + onDragStart: function (table, row) { + console.log(table) + console.log(row)} + ,onDrop: function (table, row) { + console.log(table) + console.log(row)} + }) } ) -- 2.30.2