-
Developing a netbox plugin I found the data attribute select options used to suggest options doensn't get a 'text' value; How/where are these set? I noticed for example the manufacturer model returns the same API response as my custom model does, but it does get the text label filled with the model's name property.. Seems this happends somewhere in Netbox.js, only difference I could find is that some serializers seem to inherit 'OrganizationalModelSerializer' instead of 'PrimaryModelSerializer' (I used the latter for my custom model) I expected:
But got (notice text: undefined):
The console reports;
Clearly this doesn't hold a text value, but this object seems to be generated somewhere in the javascript side, as the api response only returns the "data" element, where is this wrapped with these extra fields, and why is it omitting "text" for my custom model? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
After a bit of digging in the typescript source I found the display attribute is required for the netbox select widget to work, so I added it to my serializer and the issue was gone. api/apiSelect.ts
|
Beta Was this translation helpful? Give feedback.
After a bit of digging in the typescript source I found the display attribute is required for the netbox select widget to work, so I added it to my serializer and the issue was gone.
api/apiSelect.ts