Jump to content

Table and Form


Recommended Posts

Any suggestions on the best way to use the table helper and have its rows include form elements within a form created with the form helper?

I can't think of a good way to use both helpers together and the only way I see any form integration in the first party phtml files is where they just create the form themselves without the helper. Am I best off just doing my own form html like that? All I am even adding is what would be a Number field, so that's not so horrible to just do myself, but ti's so nice having all the validating built in by using the helper. lol.

While thinking about it I half way come up with ideas, but then think of a problem making it work, such as trying to do the form within my Table.php file. I assume I couldn't get a  $values = $form->values to work on the redirect because the table helper is setting up the table, but for the form to validate it would need to have the fields, which are not yet created until the table code is executed.

Link to comment
Share on other sites

Originally this page was for displaying a table of data only. So I already used the table helper and finished that. But, later, I realized something I was going to do with a form elsewhere could just be done by adding one field per row in that existing table. Kind of like topic listings, where the main goal is to display data, but it does have options to do things with the topics.

I guess it's possible a matrix could help, but this is one of those situations where to normal members it's just for data displaying purposes, so obviously in that situation it wouldn't need a form field.

I know many ways I can handle it. But I'm leaning towards either just manually putting the form html in the template or having a whole separate form, as it may not really need all of that data to begin with, so may be better off separate. (ie the table needs to display more than the form really would need, but just figured it would be convenient if built into that table)

Link to comment
Share on other sites

Thanks. The client really wanted it like it was in 3.x, anyway, so I just stopped fooling with it this other way. I do wish I could have got my situation to work with a Stack, though! This was all for reordering and stacks have that nice drag/drop reordering, but I would have needed it where you can't edit the actual contents, you just change the order, and I guess I could have done it with some custom form input, but it just wasn't worth the time right now, since he didn't care about it, anyway.

(for stacks you can only set the filed type, not do options for that field type, otherwise I could have set disabled... there were more issues to come after that, though, even if that had been figured out.)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...