Giter VIP home page Giter VIP logo

Comments (5)

nicolaslopezj avatar nicolaslopezj commented on May 28, 2024

Did you attach a schema to the collection? https://github.com/nicolaslopezj/simple-react-form#basic-example

from simple-react-form.

nickwild-999 avatar nickwild-999 commented on May 28, 2024

Thanks Nicolas,
Yes I did...

import {mongo} from 'meteor/mongo';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
export const Scenes = new Mongo.Collection ('scenes');

SceneSchema = new SimpleSchema({
    project_ID: {
        type:Number,
        label: "Project ID",
    },
    scene_no: {
        type: Number,
        label: "Scene Number",
    },
    createdAt: {
        type: Date,
        label: "Created At",
        //autovalue: function (){
          //return new Date()
        //}
    },
    set: {
        type: String,
        label: "Scene Number",
    },
    set_ie:{
        type: Number,
        label: "Int/Ext",
    },
    set_time: {
        type: String,
        label: "Time",
    },
    synopsis: {
        type: String,
        label: "Synopsis",
    },
    sequence:{
        type: String,
        label: "Sequence",
    },
    script_page:{
        type: String,
        label: "Script Page",
    },
    script_day:{
        type: String,
        label: "Script Day",
    },
    location:{
        type: String,
        label: "Location",
    },
    unit:{
        type: String,
        label: "Unit",
    },
    comments:{
        type: String,
        label: "Comments",
    },
});

Scenes.attachSchema(SceneSchema);

from simple-react-form.

nicolaslopezj avatar nicolaslopezj commented on May 28, 2024

You're exporting (or importing) incorrectly the collection.

Do it this way

import {mongo} from 'meteor/mongo';
import { SimpleSchema } from 'meteor/aldeed:simple-schema';
const Scenes = new Mongo.Collection ('scenes');

...

export default Scenes

You are importing it as if it was default exported (without {})

from simple-react-form.

nickwild-999 avatar nickwild-999 commented on May 28, 2024

Thanks Nicolas. I think it's sorted, but now getting...
You must pass a schema or manually render the fields(…)??

from simple-react-form.

nicolaslopezj avatar nicolaslopezj commented on May 28, 2024

Set the srf.type of the fields

import {Meteor} from 'meteor/meteor'
import Textarea from 'simple-react-form-material-ui/lib/textarea'
import Text from 'simple-react-form-material-ui/lib/text'

const Posts = new Meteor.Collection('posts')

Posts.attachSchema({
  title: {
    type: String,
    srf: {
      type: Text
    }
  },
  body: {
    type: String,
    label: 'Content',
    srf: {
      type: Textarea
    }
  }
})

or render manually the form

<Form
collection={Posts}
type='update'
ref='form'
doc={this.props.post}>
  <Field fieldName='title'/>
  <Field fieldName='body'/>
</Form>

from simple-react-form.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.