1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #4837: Use dynamic form widget for relationships to MPTT objects

This commit is contained in:
Jeremy Stretch
2020-07-09 09:50:01 -04:00
parent b535608519
commit 15525392a2
10 changed files with 28 additions and 37 deletions

View File

@ -222,6 +222,10 @@ $(document).ready(function() {
results = results.reduce((results,record,idx) => {
record.text = record[element.getAttribute('display-field')] || record.name;
if (record._depth) {
// Annotate hierarchical depth for MPTT objects
record.text = '--'.repeat(record._depth) + ' ' + record.text;
}
record.id = record[element.getAttribute('value-field')] || record.id;
if(element.getAttribute('disabled-indicator') && record[element.getAttribute('disabled-indicator')]) {
// The disabled-indicator equated to true, so we disable this option