Skip to content

marekhattas/meteor-autoform-typeahead

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

comerc:autoform-typeahead

An add-on Meteor package for aldeed:autoform. Provides a single custom input type, "typeahead", which renders an input using the typeahead plugin.

Prerequisites

The plugin library must be installed separately.

In a Meteor app directory, enter:

$ meteor add comerc:bs-typeahead
$ meteor add aldeed:autoform

Installation

In a Meteor app directory, enter:

$ meteor add comerc:autoform-typeahead

Usage

Specify "typeahead" for the type attribute of any input. This can be done in a number of ways:

In the schema, which will then work with a quickForm or afQuickFields:

{
  tags: {
    type: String,
    autoform: {
      type: "typeahead",
      afFieldInput: {
        typeaheadOptions: {},
        typeaheadDatasets: {}
      }
    }
  }
}

Or on the afFieldInput component or any component that passes along attributes to afFieldInput:

{{> afQuickField name="tags" type="typeahead"}}

{{> afFormGroup name="tags" type="typeahead"}}

{{> afFieldInput name="tags" type="typeahead"}}

To provide typeahead options, set a typeaheadOptions attribute equal to a helper that returns the options object. Most of the data- attributes that the plugin recognizes should also work.

Basic Usage

You may use autoform.options (instead of typeaheadDatasets) like this example:

{
  tags: {
    type: String,
    autoform: {
      type: "typeahead",
      options: {
        'value1': 'label1',
        'value2': 'label2'
      }
    }
  }
}

Demo

Live

Contributing

Anyone is welcome to contribute. Fork, make your changes, and then submit a pull request.

About

Custom "typeahead" input type for AutoForm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 96.9%
  • HTML 3.1%