Edit Only shows column data that were marked as get.

Edit Only shows column data that were marked as get.

jghankinsjghankins Posts: 6Questions: 0Answers: 0
edited March 2013 in Editor
After creating a record successfully, (verifying the data is in the db), if I select a record, only the columns that I tagged as get in generator are showing.

My intent is a small list of columns showing on the table, the detail record for edit and insert has more fields.

Replies

  • jghankinsjghankins Posts: 6Questions: 0Answers: 0
    As a follow up, if I go into the call to the Editor constructor and change

    [code]Field::inst( 'city' )
    ->get( false )
    ->validator( 'Validate::required' )

    to Field::inst( 'city' )
    ->get( true )
    ->validator( 'Validate::required' ) [/code]

    it fixes the display issue. Perhaps I'm misunderstanding the tutorial on the generator's intent of that feature.
  • allanallan Posts: 63,512Questions: 1Answers: 10,472 Site admin
    I think the way Generator is currently set up is somewhat confusing - it is correct in how it handles get / set, in that that are specifically marked as get / set in the PHP, but I think that it probably not that useful. What would be better would be to change the "Include in Get / Set" to "Include in: Table / Form". That will abstract out the get / set - with the ability to modify the PHP slightly if you do what to actually use the get / set options.

    Related to that, I should say that Generator is a quick start tool only - it won't let you get the most out of Editor. For that you need to work with the API to some extent, as you are seeing.

    I'll make this change to Generator soon.

    Thanks for the feedback.

    Regards,
    Allan
This discussion has been closed.