yogiben / meteor-admin

A complete admin dashboard solution
https://atmospherejs.com/yogiben/admin
GNU General Public License v3.0
826 stars 263 forks source link

Howto remove "id" field from "new" form? #377

Closed MichaelJCole closed 7 years ago

MichaelJCole commented 7 years ago

Is there a way to hide/autofill the "_id" field on the "new" form?

tsrandrei commented 7 years ago

Can you provide more details please?

MichaelJCole commented 7 years ago

Hi @ttbohemian , I wanted to use the "new" forms from the admin panel. The "id" field was required, but I didn't want to fill it in. I wanted it autogenerated.

Looking back this may be because of how I was declaring the schema:

Schema.Organizations = new SimpleSchema({
  // Public
  '_id':               { type: String, regEx: SimpleSchema.RegEx.Id, autoform: { type: 'hidden'}},
  'title':             { type: String, label: 'Organization Name', },
  'description':       { type: String, optional: true, autoform: { rows: 4}, },
  ... 

It may be better to remove the _id field from the schema. I moved on from the project, so it's moot for me now :-)

Thanks for the reply :-)

tsrandrei commented 7 years ago

Hope to help next time...