Closed miguelrs closed 6 years ago
@miguelrs Check this ticket. #384
Ok, thanks for your help @euandrei
I figured out now - that bit about the constructor arguments is a bit confusing in the docs...
Anyway, it'd be nice if you could pass some data to the Form class easily and build the default field values based on the given data inside the class...
I liked the approach of having a Form class containing everything about the form configuration, but I had to define the default values
in my Component instead of in the Form class, and had to do the same thing for the onSubmit
function (in order to access the Store), so eventually the Form class only defines (some bits of) the fields, which makes the class a bit useless... I think I will remove it and define everything in the Component...
I have defined my
EditEventForm
as a class as explained in the docs - like this:And then inside the
render()
method of some component, I create my form like:I've been reading the docs and I can't find out how I can pass that
Event
model ☝️ to my Form, so that I can set the initial values of the fields based on that...I'm sure this is such a dumb question and I'm missing something obvious, but can't figure out 😅