From: Maxime Bourget Date: Fri, 14 Jun 2013 21:16:57 +0000 (+0100) Subject: Add Ajax onclick radio. With big hack X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=65da56547e4bb2b7f7ca7abdac658fe748885b48;p=order_line_extra.git Add Ajax onclick radio. With big hack --- diff --git a/haxe/ItemScheduler.hx b/haxe/ItemScheduler.hx index bfa1744..57928f9 100644 --- a/haxe/ItemScheduler.hx +++ b/haxe/ItemScheduler.hx @@ -273,7 +273,9 @@ class ItemScheduler { var differs = untyped __php__('$user_pick != $quantity'); var checked = current_pick ? "checked": ""; var klass : String = q > available ? 'early' : ""; - inputs.push(''); + inputs.push(''); inputs.push(picked && differs ? ''+q+'' : ''+q); inputs.push(''); if(last_available) { diff --git a/hincludes/lib/ItemScheduler.class.php b/hincludes/lib/ItemScheduler.class.php index d74be7b..1c6b9ea 100644 --- a/hincludes/lib/ItemScheduler.class.php +++ b/hincludes/lib/ItemScheduler.class.php @@ -129,7 +129,7 @@ class ItemScheduler { $differs = $user_pick != $quantity; $checked = (($current_pick) ? "checked" : ""); $klass = (($q > $available) ? "early" : ""); - $inputs->push(""); + $inputs->push(""); $inputs->push(ItemScheduler_4($this, $_g, $_g1, $available, $checked, $current_pick, $differs, $inputs, $klass, $last_available, $left, $maxQuantity, $order, $picked, $q, $quantity, $row_id, $user_pick)); $inputs->push(""); if($last_available) { diff --git a/item_schedule.php b/item_schedule.php index 9ce95fc..7321c96 100644 --- a/item_schedule.php +++ b/item_schedule.php @@ -187,6 +187,15 @@ span.partial { } + function onPick(element) { + /* horible hack but it works */ + /* in the way it call an Ajax request */ + var row = $(element).closest('tr')[0]; + var table = $(element).closest('table')[0]; + onDrop(table, row); + + } + var inserts = { '#item_schedule table': function (e) { $(e).tableDnD({onDragStart: onDragStart, onDrop: onDrop})