Auftrags-Controller: Scrollbar für Positions-Tabelle und ans Ende scrollen.
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Mon, 17 Aug 2015 12:01:51 +0000 (14:01 +0200)
committerG. Richardson <information@kivitendo-premium.de>
Mon, 16 Nov 2015 15:15:56 +0000 (16:15 +0100)
SL/Controller/Order.pm
templates/webpages/order/tabs/basic_data.html

index d125968..6d7da9f 100644 (file)
@@ -157,6 +157,7 @@ sub action_add_item {
     ->val('#add_item_qty_as_number', '')
     ->val('#add_item_sellprice_as_number', '')
     ->val('#add_item_discount_as_percent', '')
+    ->run('row_table_scroll_down')
     ->focus('#add_item_parts_id_name');
 
   $self->_js_redisplay_amounts_and_taxes;
index 3bc6455..f57cde8 100644 (file)
   <table width="100%">
     <tr>
       <td>
-        <table id="row_table_id" width="100%">
-          <thead>
-            <tr class="listheading">
-              <th class="listheading" style='display:none'></th>
-              <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
-              <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/close.png" alt="[%- LxERP.t8('delete item') %]"></th>
-              <th class="listheading" nowrap width="15">[%- 'Partnumber'  | $T8 %] </th>
-              <th class="listheading" nowrap           >[%- 'Description'  | $T8 %] </th>
-              <th class="listheading" nowrap width="5" >[%- 'Qty'          | $T8 %] </th>
-              <th class="listheading" nowrap width="5" >[%- 'Price Factor' | $T8 %] </th>
-              <th class="listheading" nowrap width="5" >[%- 'Unit'         | $T8 %] </th>
-              <th class="listheading" nowrap width="15">[%- 'Price'        | $T8 %] </th>
-              <th class="listheading" nowrap width="5" >[%- 'Discount'     | $T8 %] </th>
-              <th class="listheading" nowrap width="10">[%- 'Extended'     | $T8 %] </th>
-            </tr>
-          </thead>
-
-          <tbody>
-            [%- FOREACH item = SELF.order.items_sorted %]
-              [%- PROCESS order/tabs/_row.html ITEM=item %]
-            [%- END %]
-          </tbody>
 
-        </table>
+        <div id="row_table_scroll_id" style="overflow-y: scroll; height: 500px;">
+          <table id="row_table_id" width="100%">
+            <thead>
+              <tr class="listheading">
+                <th class="listheading" style='display:none'></th>
+                <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th>
+                <th class="listheading" style='text-align:center' nowrap width="1"><img src="image/close.png" alt="[%- LxERP.t8('delete item') %]"></th>
+                <th class="listheading" nowrap width="15">[%- 'Partnumber'  | $T8 %] </th>
+                <th class="listheading" nowrap           >[%- 'Description'  | $T8 %] </th>
+                <th class="listheading" nowrap width="5" >[%- 'Qty'          | $T8 %] </th>
+                <th class="listheading" nowrap width="5" >[%- 'Price Factor' | $T8 %] </th>
+                <th class="listheading" nowrap width="5" >[%- 'Unit'         | $T8 %] </th>
+                <th class="listheading" nowrap width="15">[%- 'Price'        | $T8 %] </th>
+                <th class="listheading" nowrap width="5" >[%- 'Discount'     | $T8 %] </th>
+                <th class="listheading" nowrap width="10">[%- 'Extended'     | $T8 %] </th>
+              </tr>
+            </thead>
+
+            <tbody>
+              [%- FOREACH item = SELF.order.items_sorted %]
+                [%- PROCESS order/tabs/_row.html ITEM=item %]
+              [%- END %]
+            </tbody>
+
+          </table>
+        </div>
+
       </td>
     </tr>
 
@@ -206,6 +210,9 @@ function display_linetotal(item_id, amount) {
   $('#item_' + item_id).parents("tr").first().find('[name="linetotal"]').html(amount);
 }
 
+function row_table_scroll_down() {
+  $('#row_table_scroll_id').scrollTop($('#row_table_scroll_id')[0].scrollHeight);
+}
 
 $(function(){
   $('#order_[%- cv_id %]').change(reload_cv_dependend_selections);