Add Ajax onclick radio. With big hack
authorMaxime Bourget <bmx007@gmail.com>
Fri, 14 Jun 2013 21:16:57 +0000 (22:16 +0100)
committerMaxime Bourget <bmx007@gmail.com>
Fri, 14 Jun 2013 21:24:33 +0000 (22:24 +0100)
haxe/ItemScheduler.hx
hincludes/lib/ItemScheduler.class.php
item_schedule.php

index bfa1744533a89751cf39e6a71bed5a10a9a69963..57928f97dfedc65c327cc8ab67056ba92face386 100644 (file)
@@ -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('<input type="radio" name="'+row_id+'[to_pick]" value="'+q+'" '+checked+' class="'+klass+'">');
+                               inputs.push('<input type="radio" name="'+row_id+'[to_pick]" value="'+q+'" '+checked+' class="'+klass+'"
+                               onclick=\'onPick(this);\'
+                               >');
                                inputs.push(picked && differs ? '<span class="picked">'+q+'</span>' : ''+q);
                                inputs.push('</input>');
                                if(last_available) {
index d74be7bb7a233f9f96ca7a56ab426b63e85b8f84..1c6b9ea031f68479f48633c283a25a2d5d7a7fb5 100644 (file)
@@ -129,7 +129,7 @@ class ItemScheduler {
                                        $differs = $user_pick != $quantity;
                                        $checked = (($current_pick) ? "checked" : "");
                                        $klass = (($q > $available) ? "early" : "");
-                                       $inputs->push("<input type=\"radio\" name=\"" . $row_id . "[to_pick]\" value=\"" . _hx_string_rec($q, "") . "\" " . $checked . " class=\"" . $klass . "\">");
+                                       $inputs->push("<input type=\"radio\" name=\"" . $row_id . "[to_pick]\" value=\"" . _hx_string_rec($q, "") . "\" " . $checked . " class=\"" . $klass . "\"\x0A\x09\x09\x09\x09onclick='onPick(this);'\x0A\x09\x09\x09\x09>");
                                        $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("</input>");
                                        if($last_available) {
index 9ce95fc8c661924f6d826956f08438cbb472922a..7321c96fa9cfaafa2238f60addd8d6de09e4a9ae 100644 (file)
@@ -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})