Revision b00c1e17
Von Tamino Steinert vor 6 Tagen hinzugefügt
js/kivi.Part.js | ||
---|---|---|
137 | 137 |
$(new_rows).appendTo($('#parent_variant_table')); |
138 | 138 |
}; |
139 | 139 |
|
140 |
ns.get_selected_variants = function() { |
|
141 |
let selected_rows = []; |
|
142 |
$('[name^="variant_multi_id_"]').each( function() { |
|
143 |
if (this.checked) { |
|
144 |
selected_rows.push($(this).parents("tr").first()); |
|
145 |
} |
|
146 |
}); |
|
147 |
return selected_rows; |
|
148 |
} |
|
149 |
|
|
150 |
ns.variant_rows_toggle_selected = function() { |
|
151 |
$('[name^="variant_multi_id_"]').each( function() { |
|
152 |
this.checked = !this.checked; |
|
153 |
}); |
|
154 |
} |
|
155 |
|
|
156 |
ns.set_selected_variants_to_value = function(value_name) { |
|
157 |
let value = $('[name="' + value_name + '_for_selected_variants"]').val(); |
|
158 |
let selected_rows = ns.get_selected_variants(); |
|
159 |
selected_rows.forEach(function(row) { |
|
160 |
$(row).find( |
|
161 |
'[name="variants[].' + value_name + '"]' |
|
162 |
).val( |
|
163 |
value |
|
164 |
); |
|
165 |
}); |
|
166 |
}; |
|
167 |
|
|
140 | 168 |
ns.assortment_recalc = function() { |
141 | 169 |
var data = $('#assortment :input').serializeArray(); |
142 | 170 |
data.push( |
... | ... | |
915 | 943 |
|
916 | 944 |
$('#part_warehouse_id').change(kivi.Part.reload_bin_selection); |
917 | 945 |
|
946 |
$('#variant_select_all').click( function() { |
|
947 |
var checked = this.checked; |
|
948 |
$('[name^="variant_multi_id_"]').each(function() { |
|
949 |
this.checked = checked; |
|
950 |
}); |
|
951 |
}); |
|
952 |
|
|
918 | 953 |
ns.init(); |
919 | 954 |
}); |
920 | 955 |
}); |
Auch abrufbar als: Unified diff
Varianten: Schnellbearbeitung von Varianten