Git Product home page Git Product logo

meteor-select2's Introduction

Select2

Package for Select2

How to install

Add package

meteor add natestrauser:select2

How to use

Add a specific class in your template for the select element you want to apply Select2 to:

<select class="select2-dropdown" name="state">
  <option value="value1">value1</option>
  <option value="value2">value2</option>
</select>

Enable Select2 for the specific class in the .js file of your template:

Template.MyTemplate.onRendered(function() {
    // Enable select2
    $('.select2-dropdown').select2();
});

See also the Select2 documentation.

meteor-select2's People

Contributors

dsyko avatar nate-strauser avatar openp2pdesign avatar vslinko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

meteor-select2's Issues

Select is just displaying as a regular select

I'm utilizing the following select in the recipe template (data is dummy data for testing):

<select name="ingredient" class="select2-dropdown">
     <option value="1">Canada</option>
     <option value="2">USA</option>
     <option value="3">Mexico</option>
</select>

I am using the following code to attempt to initialize the select:

Template.recipe.onRendered(function() {
    // Enable select2
    $('.select2-dropdown').select2();
});

The package natestrauser:select2 is in my packages file and installed successfully as far as I could tell. I'm combed through the web console and I'm not seeing any jquery errors when select2() is called.

Re-size issue

I got a problem that select2 field doesn't re-size correctly when i re-size my form. Seem that ver 4.0.2 fixed that problem?

README error

According to the README , the package is named nate-strauser:select2. This package doesn't exist. In package.json, it's named natestrauser:select2 (no hyphen), which does exist in the catalog.

Meteor 1.3 support

Has anyone had any luck using this package with Meteor 1.3?

I just updated my application, and the select2s (generated by autoforms within yogiben:meteor-admin) are just rendering as normal HTML selection lists. I haven't isolated the problem yet but of course this package must be part of the issue.

Unable to install

While adding package nate-strauser:select2:
error: no such package

I was able to install with meteor add natestrauser:select2

Meteor 1.3 allowClear option not working

Hi, "allowClear" option is not working in my underconstruction new meteor 1.3 app. The rest of options I am using such as "multiple" works as expected. Also the "search" box works in others selects I have in my form.

Here is my code:

Template.startJob.onRendered(function(){
    $(document).ready(function() {
        $(".select2").select2({
            allowClear: true
        });
    });
});

Thanks!!

Path override

I removed path-override.css from packages.js in a local copy of this package to get images to load correctly with the new package system

Uncaught TypeError: $(...).select2 is not a function

I got this error . Uncaught TypeError: $(...).select2 is not a function.

My Package List Order :
meteor-platform
insecure
iron:router
useraccounts:materialize
accounts-password
froala:editor-reactive
rubaxa:sortable
miro:preloader
msavin:mongol
materialize:materialize@=0.97.0
jquery
natestrauser:select2

License model

Could you tell me what's the license model of your package? Thanks in advance.

Dropdown/clear images not showing up and config options not taking affect.

I'm not sure what I'm doing wrong but the select2 images I listed above and many of the config options aren't working for me like placeholder, and allowClear. The "width" config option works however. I would greatly appreciate any help. Here is the relevant code:

Template.contactsNew.rendered = ->
  # Initialize select boxes
  $('#status-select').select2
    allowClear: true
    placeholder: 'Select a status'
    width: '100%'

label Status
  select#status-select(name='status')
    option(value='active')    Active
    option(value='inactive')  Inactive
    option(value='prospect')  Prospect
    option(value='calling')   Calling

screen shot 2014-12-18 at 12 07 34 am

i18n support

Has anyone managed to load a language file ?
I tried to add the language file in my client/lib directory but it doesn't work...

Remote data with ajax.. how to do it?

I am looking for an example for feeding Select2 with remote data.
I know how to use an ajax request with other standard web framework, but how should I write it to use with a Meteor server method?

Update to version 3.5.1

Would enable easier updates (Select2 is a 3.4.6 now), and would point to the original source files.

Error when dismissing modal with select2

Getting this error in the console when dismissing/closing a modal that has select2 in an AutoForm.

The select2('destroy') method was called on an element that is not using Select2.

Seems odd, since there is clearly a select2 in the modal/autoform.

Issue reactive Select2

Hi, We are trying to use select2 with reactivity. however, although we are using publish and subscribe, the reactivity is not working. but the way the select2 is loading well but it is not being reactive. On the other hand if we use a normal select, the reactivity working well. Any ideas?

Events.js

Template.name_template.onCreated(function(){
Meteor.subscribe('name_Publish');
});
Template.name_template.onRendered(function(){
$("select.js-Select2Test").select2();
});

Helpers.js
import {collection_name} from '/Path';
Template.name_template.helpers({
testHelpers: function(){
return collection_name.find();
},
});

Template.html

{{#each testHelpers}} {{this._id}} - {{this.description}} {{/each}}

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.