custom component generate model in builder

  • 1
  • Idea
  • Updated 1 year ago
  • Under Consideration
Is there a way that I can have a custom component that would add a model to the page's definition on the builder side?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 1 year ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
And ideally, update that model's definition if the relevant properties of the component were changed?
Photo of Zach McElrath

Zach McElrath, Employee

  • 48,984 Points 20k badge 2x thumb
There is not a supported method for doing this in your own custom component's code right now. I'll convert this to an Idea.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
I have custom components that always need their own model, so the easiest way to make that happen is to have the component's code dynamically generate the model. It saves the time of creating the model every time in the builder.
However, if any other components need to interact with the model, or if I want to add model actions or something, it becomes much more complicated.

I'm open to other solutions/ideas, but it seems like having the component automatically add and update a model on the builder side would be really nice.