Author Topic: Layout of the drop down menu  (Read 3638 times)

aithusa

  • Newbie
  • *
  • Posts: 3
    • View Profile
Layout of the drop down menu
« on: May 20, 2015, 01:34:13 pm »
Hi,

Not sure if my previous post actually went through as it did not manage to attach the picture.
I am trying to use pgselect in my django app to allow users to multiselect in a dropdown menu.
I tried to run the js as shown on the demo page on the console and change the appearance of the drop down menu, my result is shown in the picture.
I am not sure why the elements are out of place, I have included the v1.2.0 pqselect.min.css and pqselect.min.js in my repository.
Could someone please kindly help and tell me what mistakes I have made?


Cheers!

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 5121
    • View Profile
Re: Layout of the drop down menu
« Reply #1 on: May 20, 2015, 01:48:53 pm »
Quote
I tried to run the js as shown on the demo page on the console and change the appearance of the drop down menu, my result is shown in the picture.

Please also include the custom changes you have made, preferably a jsfiddle.

aithusa

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Layout of the drop down menu
« Reply #2 on: May 20, 2015, 02:19:56 pm »
Code: [Select]
$("#select1").pqSelect({
    multiplePlaceholder: 'Select Countries',   
    checkbox: true //adds checkbox to options   
}).pqSelect( 'open' );

I ran this code in the console, replacing select1 with my own identifier.
https://jsfiddle.net/5eftptfa/#&togetherjs=MNKKxV3DHv
I am new to js, do I have to include the css and js of pqSelect in jsfiddle as well?

aithusa

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Layout of the drop down menu
« Reply #3 on: May 26, 2015, 03:05:20 pm »
I got it working at last! Turns out there were predefined style in my project for labels, so it messed up the drop down menu.

i have another question now, is it possible to not show the choices automatically everytime the dropdown menu is shown?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 5121
    • View Profile
Re: Layout of the drop down menu
« Reply #4 on: May 27, 2015, 01:16:56 pm »
If I understood your question correctly, it's quite easy.

just don't append .pqSelect( 'open' ) when you initialize the pqSelect list.