Revision 59da90f6
Von Bernd Bleßmann vor fast 9 Jahren hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
371 | 371 |
->run('row_table_scroll_down') |
372 | 372 |
->run('row_set_keyboard_events_by_id', $item_id) |
373 | 373 |
->run('set_unit_change_with_oldval_by_id', $item_id) |
374 |
->run('renumber_positions') |
|
374 | 375 |
->on('.recalc', 'change', 'recalc_amounts_and_taxes') |
375 | 376 |
->on('.reformat_number', 'change', 'reformat_number') |
376 | 377 |
->focus('#add_item_parts_id_name'); |
... | ... | |
429 | 430 |
$self->js |
430 | 431 |
->run('close_multi_items_dialog') |
431 | 432 |
->run('row_table_scroll_down') |
433 |
->run('renumber_positions') |
|
432 | 434 |
->on('.recalc', 'change', 'recalc_amounts_and_taxes') |
433 | 435 |
->on('.reformat_number', 'change', 'reformat_number') |
434 | 436 |
->focus('#add_item_parts_id_name'); |
templates/webpages/order/tabs/_row.html | ||
---|---|---|
11 | 11 |
[% L.hidden_tag("order.orderitems[+].id", ITEM.id, id='item_' _ ID) %] |
12 | 12 |
[% L.hidden_tag("order.orderitems[].parts_id", ITEM.parts_id) %] |
13 | 13 |
</td> |
14 |
<td> |
|
15 |
<div name="position" class="numeric"> |
|
16 |
[% HTML.escape(ITEM.position) %] |
|
17 |
</div> |
|
18 |
</td> |
|
14 | 19 |
<td align="center"> |
15 | 20 |
<img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]" class="dragdrop"> |
16 | 21 |
</td> |
templates/webpages/order/tabs/basic_data.html | ||
---|---|---|
154 | 154 |
<thead> |
155 | 155 |
<tr class="listheading"> |
156 | 156 |
<th class="listheading" style='display:none'></th> |
157 |
<th class="listheading" nowrap width="3" >[%- 'position' | $T8 %] </th> |
|
157 | 158 |
<th class="listheading" style='text-align:center' nowrap width="1"><img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]"></th> |
158 | 159 |
<th class="listheading" style='text-align:center' nowrap width="1"><img src="image/close.png" alt="[%- LxERP.t8('delete item') %]"></th> |
159 | 160 |
<th class="listheading" nowrap width="15">[%- 'Partnumber' | $T8 %] </th> |
... | ... | |
334 | 335 |
var row = $(clicked).parents("tbody").first(); |
335 | 336 |
$(row).remove(); |
336 | 337 |
|
338 |
renumber_positions(); |
|
337 | 339 |
recalc_amounts_and_taxes(); |
338 | 340 |
} |
339 | 341 |
|
... | ... | |
515 | 517 |
email_dialog.dialog("close"); |
516 | 518 |
} |
517 | 519 |
|
520 |
function renumber_positions() { |
|
521 |
$('.row_entry [name="position"]').each(function(idx, elt) { |
|
522 |
$(elt).html(idx+1); |
|
523 |
}); |
|
524 |
} |
|
525 |
|
|
518 | 526 |
|
519 | 527 |
$(function(){ |
520 | 528 |
$('#order_[%- cv_id %]').change(reload_cv_dependend_selections); |
... | ... | |
539 | 547 |
set_unit_change_with_oldval($('.unitselect')); |
540 | 548 |
}); |
541 | 549 |
|
550 |
$('#row_table_id').on('sortstop', function(event, ui) { |
|
551 |
renumber_positions(); |
|
552 |
}); |
|
542 | 553 |
</script> |
Auch abrufbar als: Unified diff
Auftrags-Controller: Positions-Spalte anzeigen und renummerieren bei Änderungen.