I'm currently trying to make the grid work with edit/create forms loaded from the server.
I have searched the documentation, and the forums but haven't been able to find the right way to do that.
I want to build and validate my forms server-side (using Symfony).
For now I only tried with the "editable" option set to "popup".
Here's what I'm trying to achieve :
- When clicking on the edit button, make an AJAX request on a URL I have added to the grid configuration. The request will contain the ID (the value of the field name specified in dataSource.schema.id) of the row I'm editing. It would also be nice to be able to add some kind of loader class on the button and disable it while we wait for the response.
- On the server, generate a form (pre-populated after fetching the object using its ID) and return the HTML in a JSON object.
- In the "ajax.success" function, open the popup and fill it with the HTML we just got back from the server.
- Change some values, submit the form to the server and validate the data on the server then do the same things we did at step 2 except this time the JSON object will also contain extra success/error messages.
Would there also be a way to do the same thing with the "editable" option set to "inline"?