Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save FirstVertex/b083f8737ed43d83a997 to your computer and use it in GitHub Desktop.

Select an option

Save FirstVertex/b083f8737ed43d83a997 to your computer and use it in GitHub Desktop.
Select2 with Primary selected item 3/4
$(function() {
// create an instance of PrimarySelect2 and attach to our Troop selector
// we set no special Select2 options. you could pass the normal Select2 options struct here, it will be passed to Select2 constructor
var s2Options = {};
var ps2 = PrimarySelect2($('#Troops'), s2Options);
// ps2 is your handle now to the PrimarySelect2 interface
// if you're in a dynamic form later during your cleanup just call
// ps2.destroy();
});
@FirstVertex

Copy link
Copy Markdown
Author

see here for all code

@FirstVertex

Copy link
Copy Markdown
Author

see here for full explanation on my Blog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment