ecarlotti:autoform-duallistbox

v0.0.4Published 6 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

meteor-autoform-duallistbox

Adds the ability to use a transfer select to Autoform. It uses the Bootstrap Dual Listbox library.

Originally forked from AutoForm Select Transfer. The fork was done to update the bootstrap dual list box component to its latest version and also to add compatibility with some missing AutoForm settings, like the default "disabled" state which is not present by defaut in the bootstrapDualListBox component.

Install

To install the package run the following command:

meteor add ecarlotti:autoform-duallistbox

Usage

{{> afQuickField name='myOption' class='input-sm' type='duallistbox' multiple='true' options=selectOptions bootstrapDualListboxOptions=bootstrapDualListBoxOptions}}
Template.x.helpers({
  selectOptions: function() {
    return [
     { label: 'Some label', value: 'Some value'},
     { label: 'Some label 2', value: 'Some value2'},
     ...
    ];
  },
  bootstrapDualListBoxOptions: function() {
    return {
      moveOnSelect: false,
      moveOnDoubleClick: true,
      preserveSelectionOnMove: false,
      showFilterInputs: true,
      nonSelectedFilter: '',
      selectedFilter: '',
      btnClass: 'btn-default'
    };
  }
});