Skip to content

Adds a custom input type called "relation" to the aldeed:autoform package for when we need to add a reference to a record (or records) in another collection. Includes an integration with meteorhacks:searchsource to provide full text search capabilities.

Notifications You must be signed in to change notification settings

sjkdev21/autoform-relations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#autoform-relations#

###Description### Adds a custom input type called "relation" to the Aldeed's meteor-autoform package for when we need to add a reference to a document (or documents) in another collection. Includes an integration with meteorhacks:searchsource to provide full text search capabilities.

###Usage###

meteor add skehoe1989:autoform-relations

Add the 'relation' input type to the autoform property in your collection's SimpleSchema:

autoform-relations

CoursesSchema = new SimpleSchema({
    'title': {
        type: String
    },
    'category' : {
      type: String
    },
    'classes' : {
      type: [String],
        autoform: {
            type: 'relation',
            settings: {
                collection: 'Classes',
                fields: ['title', 'description'],
                options: {
                    keepHistory: 1000 * 60 * 5,
                    localSearch: true
                }
            }
        }
    },
    'instructor': {
        type: String,
        optional: true
    },
    'description': {
        type: String,
        optional:true,
        autoform: {
            rows: 20,
            type: 'markdown'
        }
    }

});

Settings Explained

  • collection - The name of the collection you want to search/add document references from.
  • fields - An array of field names from the collection specified that you want to search over. Passes through to meteorhacks:searchsource
  • options - Options to be passed to meteorhacks:searchsource that can enable search caching, local search, and paged results.

Maintained by BitTiger

BitTiger Logo

About

Adds a custom input type called "relation" to the aldeed:autoform package for when we need to add a reference to a record (or records) in another collection. Includes an integration with meteorhacks:searchsource to provide full text search capabilities.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published