✅ What should I do with the attributes?
can you give advice on how to do it better? I just can't think of...
here I have a field over which custom attributes are defined
with the
Component
attribute, there are no problems, we just pass a string that indicates which component to draw
but with ComponentOptions
, everything is more complicated, because the options are a separate class and I would like the user to fill it in, but since we cannot pass it to the attribute class, then I do not know what to do
And this is possible class for ComponentOptions
but I can't use it in attribute
11 Replies
attributes need to be compile time constant, so yeah you can't use classes
it's a problem 😦
I need following logic for user:
"hm, I need to create DepartmentsTreeSelect so I will use InputType.DepartmentsTreeSelect in ComponentAttribute
than.. I need to define some properties for this component. Hm, okey let's add some properties like order etc to ComponentOptions
then do that?
you cant have a complicated nested structure in your options, it needs to be flat
and what is Order in your case?
it is a property inside a class?
its a property inside the attribute class
in general this shouldnt be its own attribute imho, it should be part of
Component
idk.. how it will be look?
hm interesting
I will try to do smth the same
thanks
give it a try.
what do you think about this?
I do this because I need to use properties from defined class
That won't work,
Order
is readonly there.