* Init the roadmap picker when change product.

This commit is contained in:
hufangzhou
2024-05-22 15:33:08 +08:00
parent f3507679f7
commit f2ed93d9f5
+6
View File
@@ -77,6 +77,11 @@ window.loadRoadmap = function(product)
let branchID = product.closest('.productBox').find('.linkBranch .pick-value').val();
let link = $.createLink('demand', 'ajaxGetRoadmaps', 'productID=' + productID + '&branch=' + branchID + '&param=distributable');
const $roadmap = product.closest('.productBox').find('.roadmapBox .pick-value');
$roadmap.closest('.picker-box').removeClass('hidden');
$roadmap.closest('.linkRoadmap').find('[name^=roadmapName]').addClass('hidden');
$roadmap.closest('.linkRoadmap').find('[name^=roadmapName]').attr('disabled', 'disabled');
$roadmap.zui('picker').render({disabled: false});
$.getJSON(link, function(data)
{
$roadmap.zui('picker').render({items: data});
@@ -84,6 +89,7 @@ window.loadRoadmap = function(product)
let optionCount = $roadmap.zui('picker').options.items.length;
$roadmap.closest('.input-group').find('.addRoadmap').toggleClass('hidden', !productID || (productID != 0 && optionCount));
$roadmap.closest('.input-group').find('[name^=addRoadmap]').prop('checked', false);
});
}