meteor-autoform

Getting Exception in template helper: quickFormContext with aldeed:autoform

孤者浪人 提交于 2020-01-06 16:19:45
问题 I'm having an issue with aldeed:autoform which I can't solve, nor understand what is the cause. The template: <template name="staffCaseEdit"> {{> quickForm collection=Cases id="inserNewItem" type="insert"}} </template> I use aldeed:collection2 and aldeed:simple-schema to manage collections. So, I have the Case schema and Cases collection, both defined in /lib so they should be available on the client side, too. Next, there's the route: FlowRouter.route('/staff/case/:id', { triggersEnter: [

load collections to a quickform in meteor

安稳与你 提交于 2019-12-25 08:42:37
问题 I created two seperate schemas for payments collection and memberProfile . Now I need to create a quickform so I could load all the payments relevant to a unique memberProfile. //The code for memberPayment collection MemberProfiles = new Mongo.Collection('memberProfiles'); RecipeSchema = new SimpleSchema({ name: { type: String, label: "Name" }, desc: { type: String, label: "Description" }, payments:{ type: [PaymentSchema], autoValue: function () { return Payments.find({ memberId="uniqueId"});

Select category not updating sub category

送分小仙女□ 提交于 2019-12-25 06:44:42
问题 This is suppose to look at the users category selection and then update the subcategory. The solution was recommended by someone else but I can't seem to get it to work. When I select the category, subcategory doesn't update. Can someone let me know what I'm missing. Path: category.js <template name="category"> {{#autoForm collection="Meteor.users" id="categoryForm" doc=currentUser type="update"}} {{> afQuickField name='profile.categories'}} {{/autoForm}} </template> Path: Schema.js var

Error when updating an object in auto-form with meteor

社会主义新天地 提交于 2019-12-25 06:36:29
问题 I have checked the docs but I cannot get my head around this. I have an object that I want to update using Auto-Form and Collections2 with meteor. //Schema Records = new Mongo.Collection('records'); var Schemas = {}; Schemas.Record = new SimpleSchema({ title: { type: String, label: "Title", max: 200 }, caption: { type: String, label: "Caption", max: 200 }, text: { type: String, label: "Detailed text", optional: true, max: 1000 }, loc: { type: Object, optional: true, blackbox: true },

Error when updating an object in auto-form with meteor

血红的双手。 提交于 2019-12-25 06:35:09
问题 I have checked the docs but I cannot get my head around this. I have an object that I want to update using Auto-Form and Collections2 with meteor. //Schema Records = new Mongo.Collection('records'); var Schemas = {}; Schemas.Record = new SimpleSchema({ title: { type: String, label: "Title", max: 200 }, caption: { type: String, label: "Caption", max: 200 }, text: { type: String, label: "Detailed text", optional: true, max: 1000 }, loc: { type: Object, optional: true, blackbox: true },

Bind allowedValues to values from a collection in simple-schema

耗尽温柔 提交于 2019-12-24 15:03:04
问题 I'm using aldeed:simple-schema and here's the code: Cities = new Mongo.Collection('cities'); Cities.insert({ name: 'Oslo' }); Cities.insert({ name: 'Helsinki' }); Contact = new SimpleSchema({ city: { type: String, allowedValues: Cities.find().map((e) => e.name) // written ES6-style for readability; in fact, here goes an ES5 anonymous function definition } }); What it does is explicitly binds currently existing cities from Cities collection to Contact schema's certain field's allowed values,

How to add user id information in the schema and also hide form autoforms?

孤人 提交于 2019-12-24 12:50:25
问题 I am learning the ropes of Meteor and kind of lost here. I am using collections2, autoform for building my application. I want to store the collection along with user id information. So that when we retrieve the collection from the server, I want to show only the ones the user created not everything else. here is the schema. ExercisesSchema = new SimpleSchema({ "name": { type: String, label: 'Name' }, "workout.$.weight": { type: String, label: 'Weight' }, "workout.$.reps": { type: String,

How to add a relationship or reference with AutoForm in Meteor?

拈花ヽ惹草 提交于 2019-12-24 10:39:33
问题 I use meteor-autoform to insert documents in a collection. My Items has a field groupId . How can I insert this group id when I'm submitting my item form. <template name="itemForm"> {{#autoForm type="insert" collection=Collections.Items}} {{> afQuickField name="name"}} <div class="form-group"> <button type="submit" class="btn btn-primary">Add item</button> <button type="reset" class="btn btn-default">Reset Form</button> </div> {{/autoForm}} </template> I could create another field containing

Boolean in nested schema causing required state

耗尽温柔 提交于 2019-12-23 04:26:34
问题 I have schemas set up so that I can have an array of complex input sets via autoform. Something like: address = { street:{ type: String }, city: { type: String }, active_address: { type: Boolean, optional: true }, ... } people: { name:{ type: String }, address:{ type: [address], optional: true, defaultValue: [] } } This way adding an address is optional, but if you add an address all of the address fields are required. Trying to submit the form throws a required error for every field under

How to dynamically change the value of an optional attribute of a field in Autoform / SimpleSchema?

心已入冬 提交于 2019-12-14 03:05:11
问题 I have a SimpleSchema instance with two fields: isApproved: { type: Boolean, defaultValue: false }, impactedSystems: { type: String, optional: true } I'd like to change the optional attribute of impactedSystems to false if isApproved is set to true . I've tried following the instructions in the docs but I can't get it to work. It suggests I add a custom function to impactedSystems like so (modified with my field names): custom: function () { var shouldBeRequired = this.field('isApproved')