function updateParentOptions()

in script.js [962:982]


  function updateParentOptions() {
    if (!mgParentIdSelect) {
      console.error('Parent ID select element not found');
      return;
    }

    try {
      mgParentIdSelect.innerHTML = '<option value="null">None (Root)</option>';

      if (currentData && currentData.management_groups) {
        currentData.management_groups.forEach(mg => {
          const option = document.createElement('option');
          option.value = mg.id;
          option.textContent = `${mg.display_name} (${mg.id})`;
          mgParentIdSelect.appendChild(option);
        });
      }
    } catch (error) {
      console.error('Error updating parent options:', error);
    }
  }