MX modal to do an update?
1 years ago
1 years ago
#1
I don't know, perhaps I missed it. I was watching one of DavCon's videos on MX, he created a page with index table of members, and a modal to create a new member, and a button to directly delete a member on the index table. I looked all over for some hint as to how to create a model form to update the member data, and I couldn't find it. Can you steer me in the direction of where to find a tut on setting up an MX modal to do an update?
1 years ago
#2
★ Winning Post! ★
The thread creator has indicated that this post solved the problem or provided the best insight.
Members who post winning responses earn points for our leaderboard.
Points mean prizes!
DC here! The way to look at it is to forget about about Trongate MX and think about ordinary form handling. So, imagine that you're building an ordinary module with some kind of CRUD functionality. In that instance, you'd probably have a view file that contains a form. Perhaps the view file is called 'create.php' or 'form.php' or something like that. In any event, the details on how to open modal windows are covered here:
https://trongate.io/documentation/display/trongate_mx/ui-enhancements/building-dynamic-modals
If there is anything about the above page that is unclear or confusing then please DO let me know. You'll be doing me a huge favour.
Also, your goal should be to have an endpoint that serves (just) the view file with the form. So, when you build your modal button (or whatever the trigger may be), you should be submitting an HTTP GET request to the endpoint that serves the form.
Thereafter, your next challenge is, "How to submit the form and perform validation etc". This is all covered here:
https://trongate.io/documentation/display/trongate_mx/form-handling/form-validation-and-error-handling
However, once again, if you find any of the information there to be confusing in any way at all please DO let me know.
I'll end by saying that I'm really happy with Trongate MX but I'm concerned that the documentation may be confusing or unclear. If that's the case, please do not hesitate to let me know and I'll be glad to help.
DC