I. The role of jquery MultiSelect
We make a comparison with the select tag. Select Tags I believe that we should all use, we do query often use the select as the condition to query, but select has a disadvantage, that is, you can only select one of the criteria to filter the query, select need to select a number of criteria query, That would be more troublesome to achieve. So the jquery MultiSelect is dealing with this. This is
After selection
Too much content is this effect
Second, usage
Referencing JS files and CSS files
Jquery-ui.min.js,
Jquery.multiselect.js
Jquery.multiselect.css
Jquery-ui.css
$(function(){
ID Q_contractstatus is a value of the hidden field on the page, the foreground is selected, or the background is passed over to show. varSelected = $ (' #q_contractStatus '). Val (); Selected= ', ' + selected + ', '; vararr = Selected.split (', ');
Loop to determine which need to tick $ (' #contrStatus option '). each (function() { if(Selected.indexof (', ' + This. Value + ', ')! =-1) This. selected =true; });
Here is the main content $ (' #contrStatus '). MultiSelect ({header:true, Height:400, MinWidth:100, Checkalltext:' √ Select all ', Uncheckalltext:' X is not all selected ', SelectedText:' # is selected ', Selectedlist:4, Hide: [", 400], Noneselectedtext:' = = = Please select = = = ', close:function(){ varvalues1=$ (' #contrStatus '). Val (); if(values1==NULL){ $(' #q_contractStatus '). Val ('); } if(values1.length>0){
The selected value is placed in the hidden field, and the query is made directly with the hidden field $ (' #q_contractStatus '</script> <body> <select id= ' contrstatus ' name= ' contrstatus ' multiple= ' multiple ' style= ' width:190px ' > <option value= "1" > Contract pending sign </option> <option value= "2" > Confirm return </option> <o Ption value= "3" > Refused credit </option> <option value= "4" > Contract pending Confirmation </option> <option value= "5" Contract confirmed </option> <option value= "6" > Audit return </option> <option value= "7" > Contracted </OPTION&G T <option value= "8" > Pending loan </option> <option value= "9" > Loan failure </option> <option value= "1 0 "> Loan </option> <option value=" + "> Preliminary examination confirmed </option> <option value=" "" "" "> Review return </ Option> <option value= "$" > Contract timeout </option> <option value= "$" > Expiration paid off </option> <option value= "" "> Maturity due to principal and interest </option> <option value=" "" > Due liquidated damages </option> <option Value= "&G"t; one-time settlement </option> <option value= "<option" > Loan Review return </option> value= "$" > Financial lending back </ option> <option value= ">" Signed (resubmitted) </option> <option value= "One" > Lender withdrawal </option>& Lt;option value= "> Customer abandonment </option></select>
My code implementation is here, with a hidden field value I think clear.
Demo See Accessories
About jquery MultiSelect usage