->run('row_table_scroll_down')
->run('row_set_keyboard_events_by_id', $item_id)
->run('set_unit_change_with_oldval_by_id', $item_id)
+ ->run('renumber_positions')
->on('.recalc', 'change', 'recalc_amounts_and_taxes')
->on('.reformat_number', 'change', 'reformat_number')
->focus('#add_item_parts_id_name');
$self->js
->run('close_multi_items_dialog')
->run('row_table_scroll_down')
+ ->run('renumber_positions')
->on('.recalc', 'change', 'recalc_amounts_and_taxes')
->on('.reformat_number', 'change', 'reformat_number')
->focus('#add_item_parts_id_name');
[% L.hidden_tag("order.orderitems[+].id", ITEM.id, id='item_' _ ID) %]
[% L.hidden_tag("order.orderitems[].parts_id", ITEM.parts_id) %]
</td>
+ <td>
+ <div name="position" class="numeric">
+ [% HTML.escape(ITEM.position) %]
+ </div>
+ </td>
<td align="center">
<img src="image/updown.png" alt="[%- LxERP.t8('reorder item') %]" class="dragdrop">
</td>
<thead>
<tr class="listheading">
<th class="listheading" style='display:none'></th>
+ <th class="listheading" nowrap width="3" >[%- 'position' | $T8 %] </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>
var row = $(clicked).parents("tbody").first();
$(row).remove();
+ renumber_positions();
recalc_amounts_and_taxes();
}
email_dialog.dialog("close");
}
+function renumber_positions() {
+ $('.row_entry [name="position"]').each(function(idx, elt) {
+ $(elt).html(idx+1);
+ });
+}
+
$(function(){
$('#order_[%- cv_id %]').change(reload_cv_dependend_selections);
set_unit_change_with_oldval($('.unitselect'));
});
+$('#row_table_id').on('sortstop', function(event, ui) {
+ renumber_positions();
+});
</script>