Solved

select2 formatting changes when you set multiple = true

Posted on 2014-12-24
10
509 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40517043
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
ID: 40517851
thanks - will try to this week :)
0
 

Author Comment

by:andieje
ID: 40517859
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:andieje
ID: 40517872
does the code you posted solve both? thanks
0
 
LVL 58

Expert Comment

by:Gary
ID: 40517875
No, but that is a different question.
0
 

Author Comment

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

Expert Comment

by:Gary
ID: 40517887
What gets smaller
0
 

Author Comment

by:andieje
ID: 40517894
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
ID: 40517915
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
ID: 40518599
no - i set the fixed width on the input :)
0

Featured Post

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PHP and JQuery Syntax question 4 34
multiple selects 23 62
Worldmap 1 28
javascript and jquery question 4 26
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

726 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