Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use jquery/javascript in pqselect #15

Open
tranvietha opened this issue Apr 13, 2016 · 1 comment
Open

use jquery/javascript in pqselect #15

tranvietha opened this issue Apr 13, 2016 · 1 comment

Comments

@tranvietha
Copy link

Dear everyone,

I have used pqselect for my website. It works very good but I have 2 question need your help.

First, how can i disable several option?
Second, how can i select several option after select control was created?

This's my jquery code:

$("#selectUserSameRole").append(optListUser); //variable "optListUser " I get from server.
$("#selectUserSameRole").pqSelect({
multiplePlaceholder: '-- Select user --',
checkbox: true //adds checkbox to options
}).on("change", function(evt) {
var val = $(this).val();
document.getElementById('lstSelectedSameRole').value = val;
}).pqSelect('open');

Tks all.

@paramquery
Copy link
Owner

  1. add disabled attribute to the options.

  2. $( ".selector" ).val( array of selected options );

Do refreshData http://paramquery.com/api/select#method-refreshData

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants