Solved

select2 formatting changes when you set multiple = true

Posted on 2014-12-24
10
377 Views
Last Modified: 2014-12-26
Hi

If you look at this jsfiddle
 http://jsfiddle.net/pHSdP/2/

Open in new window

and set multiple = true the dropdown arrow disappears. Please can you advise how to keep the dropdown arrow

Thanks and Merry Christmas
0
Comment
Question by:andieje
  • 6
  • 4
10 Comments
 
LVL 58

Expert Comment

by:Gary
Comment Utility
Since there is nothing in the plugin to set it you will have to add your own

http://jsfiddle.net/pHSdP/782/

.select2-container-multi .select2-choices {
    background:url("/path_to/dropdown_arrow.png") no-repeat right center !important
}

Open in new window

0
 

Author Comment

by:andieje
Comment Utility
thanks - will try to this week :)
0
 

Author Comment

by:andieje
Comment Utility
Also if you delete a tag it goes mental too. It just gets narrower and and narrower, It doesnt have  a min widht, Sorry if i seem useless but i'm nervous about jquery,
0
 

Author Comment

by:andieje
Comment Utility
does the code you posted solve both? thanks
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
No, but that is a different question.
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:andieje
Comment Utility
As you delete items from select 2 it gets smaller and smaller until it barely visible
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
What gets smaller
0
 

Author Comment

by:andieje
Comment Utility
the select box. until its only about 5mm. It doesnt disappear completely

This worked for the select but not for the input type

.select2-container-multi .select2-choices {
    background:url("/path_to/dropdown_arrow.png") no-repeat right center !important
}

I had to set fixed-width
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
Comment Utility
Then just set a fixed width on the input

.select2-container-multi .select2-choices {
     background:url("/path_to/dropdown_arrow.png") no-repeat right center !important;
     width:200px
 }

Open in new window


Or create a test page online I can look at because even in the fiddle above that's not happening or I am not understanding what you are talking about.
0
 

Author Comment

by:andieje
Comment Utility
no - i set the fixed width on the input :)
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now