programmatic access

Select2 supports methods that allow programmatic control of the component:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

eg code:

  1. $(“#e8”).select2();
  2. $(“#e8_get”).click(function () { alert(“Selected value is: “+$(“#e8”).select2(“val”));});
  3. $(“#e8_set”).click(function () { $(“#e8”).select2(“val”, “CA”); });
  4. $(“#e8_open”).click(function () { $(“#e8”).select2(“open”); });
  5. $(“#e8_close”).click(function () { $(“#e8”).select2(“close”); });
  6. $(“#e8_2”).select2();
  7. $(“#e8_2_get”).click(function () { alert(“Selected value is: “+$(“#e8_2”).select2(“val”));});
  8. $(“#e8_2_set”).click(function () { $(“#e8_2”).select2(“val”, [“CA”,”MA”]); });
  9. $(“#e8_2_open”).click(function () { $(“#e8_2”).select2(“open”); });
  10. $(“#e8_2_close”).click(function () { $(“#e8_2”).select2(“close”); });

28 responses »

  1. Real great info can be found on this web blog.

  2. You have noted very interesting points! ps decent web site.

  3. I love your wonderful writing. great information. I hope you release more. I will carry on watching

  4. I view something really interesting about your weblog so I bookmarked .

  5. I regard something genuinely interesting about your weblog so I saved to bookmarks .

  6. I adored your rich words. awesome work. I hope you produce others. I will carry on subscribing

  7. Cheers, I just stopped by to visit your blog and thought I’d say I had a great visit.

  8. Hello, i think that i saw you visited my weblog thus i came to “return the want”.I am trying to to find issues to enhance my website!I guess its ok to use a few of your ideas!!

  9. Aion Kinah says:

    This writing has inspired me to continue working on my own blog

  10. click this says:

    Cheers, I just stopped in to visit your site and thought I’d say I had a great visit.

  11. I like your rich writing. brilliant information. I hope you produce many. I will carry on subscribing

  12. Very interesting information!Perfect just what I was looking for!

  13. vitamin says:

    Very interesting information!Perfect just what I was looking for!

  14. l-tyrosine says:

    I regard something truly interesting about your web site so I bookmarked .

  15. incontinence says:

    Real wonderful information can be found on this web site.

  16. picamilon says:

    Very interesting information!Perfect just what I was searching for!

  17. picamilon says:

    Really great info can be found on this blog.

  18. nootropics says:

    Hello, i believe that i saw you visited my site thus i got here to “return the desire”.I’m trying to in finding issues to enhance my website!I assume its good enough to make use of a few of your ideas!!

  19. Superb blog you have here but I was wondering if you knew of any user discussion forums that cover the same topics discussed here? I’d really like to be a part of online community where I can get suggestions from other experienced individuals that share the same interest. If you have any suggestions, please let me know. Thanks a lot!

  20. Very fantastic information can be found on this website.

  21. Greeting from over the world. precise post I will return for more.

  22. aion kinah says:

    hi I thought you may like my information

  23. An awesome book to win.

  24. Hello sweetheart, from a young teen follower, I love this type of work! Don’t stop!

  25. mind matter says:

    I got what you intend, thankyou for posting .Woh I am thankful to find this website through google. “The outcome of the war is in our hands the outcome of words is in the council.” by Homer.

  26. Mart Janszen says:

    There is evidently a bundle to realize about this. I think you made certain good points in features also.

  27. Hello dear, from a youthful woman fan, I love this type of stuff! Keep it up!

As salam. Hi. Leave a Comment?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s