0.0.20 form mover
This commit is contained in:
@@ -56,10 +56,28 @@ function updateCargoTypeInForm(el, type_transport) {
|
||||
getCargoTypesWTypeTransport({
|
||||
type_transport: type_transport,
|
||||
owner_type: getFormOwnerType(el),
|
||||
success_callback: function (res) {
|
||||
|
||||
}
|
||||
success_callback: success_callback_func,
|
||||
})
|
||||
|
||||
function success_callback_func(res) {
|
||||
let cargo_types = res.cargo_types
|
||||
if (!cargo_types) return;
|
||||
|
||||
resetWRadioInputs('cargo_type');
|
||||
let $widget = getWRadioInputsWidget('cargo_type');
|
||||
for (let cargo_type of cargo_types) {
|
||||
let obj = {
|
||||
name: cargo_type[0],
|
||||
title: cargo_type[1],
|
||||
}
|
||||
|
||||
let html = generateRadioInput(obj)
|
||||
|
||||
if ($widget.firstElementChild){
|
||||
$(html).insertAfter($($widget.firstElementChild))
|
||||
} else {
|
||||
$widget.innerHTML = html
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user