Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Form Model

edited March 2010 in Vanilla 2.0 - 2.8
(Two questions today. I'm on a roll!)

I've created most of my application. All the information is displaying properly and I can edit info and save it back to the database. However, there are some usability improvements I'd like to implement that will streamline the records updating process greatly.

At the moment, I'm displaying a list of elements. Now if you want to edit one of those elements, you have to click "Edit" and that takes you off to a form with the data pre-populated. You can then edit any of that info for the specific element and save it back to the database. It would be very nice, and nearly essential to making this a usable application, if the user could edit all the elements as if it were a table, and then save the entire set at once without having to go through each individual element on it's own form.

Can I achieve this using the Form Model in Garden?

Basically, I want to spit out a large form based off the information in a database table. Then, I'd like to be able to edit that information on one screen and save it all back to the database with one click.

It may be beneficial if I give a concrete example; I'll use the User database as an example for what I'm trying to achieve:

We have a table of users in the database. Using the Garden admin, you can go to the User list. The User list displays several bits of info about each user in the system and then includes an "Edit" button to the right where you can change information about that particular user.

For the case of this example, let's say I want to change that display. I want the User list to display editable text fields of each user in the database. It will display the same information as the table above, but this time each bit of info is editable directly from the User list without having to click on the "Edit" button. Then, to save it all you click on a "Save" button at the very bottom of the form.

Is this possible with the Form Model? How would one go about doing this with Garden?

Comments

  • lucluc ✭✭
    Your edit stuff is one of the thing available in the Models documentation (http://vanillaforums.org/page/Models). Have you read it?

    That's the last example.
  • I've read through that. I can edit individual entries when I follow this example. Where I'm running into trouble is where I try to edit multiple entries at once. I'm having problems figuring out how to cycle through the different elements and save them all back to the database.

    I'll do some more research and see what I can find.
  • How about using javascript, so each one is individually editable by default and using ajax you can just send the content back for each one.
Sign In or Register to comment.