MSFmultiSelect (multiselect) is a pure JavaScript user-friendly multiselect library, don't need jQuery. It's very easy to use for developers and fast. latest version 2.4
Give DOM select element, this element posted in your backend.
settings (Optional)
Give object of settings your mulitiselect.
appendTo : give element selector string, it uses to target place to create multiselect.
width : It is control of the mulitiselect width.
height : It is control of the mulitiselect height.
className : if you need any custom style, give css class name, it will apply to mulitiselect.
onChange : When multiselect is changed this callback function will run. In this function, there are three parameters.
checked : you receive boolean data, selected item checked, or unchecked.
value : You get selected item value.
instance : It's instance variable of mulitiselect, you can access multiselect properties and methods
selectAll : If your given value is true, then the select-all feature is will enable. It helps one click to select all options
afterSelectAll : When users click the select-all feature this callback function will run. In this function, there are three parameters.
checked : you receive boolean data, selected item checked, or unchecked.
values : You get selected item values in array.
instance : It's instance variable of mulitiselect, you can access multiselect properties and methods
searchBox : If your given value is true, the search box feature is will enable. It helps to search the option values.
theme : There are two themes available. They are theme1 and theme2. theme1 is a regular multi-select, theme2 multi-select have directly remove selected value option button.
autoHide : If your given value is false, selectable values always displayed on the screen.
This method is used to add selected values, this method needs two arguments, sellectedValues argument value has select option values in an array format. If you changeTrigger argument value is true then it triggers to onChange event.
This method is used to remove selected values, this method needs two arguments, removeSellectedValues argument value has select option values in an array format. If you changeTrigger argument value is true then it triggers to onChange event.
code : select.removeValue(['4','8']); //give select option values in array
MSFmultiSelect.getData()
This methods use to get selected values of multiselect
domo : click here print to selectd value in console log
code : console.log(select.getData());
MSFmultiSelect.selectAll(ctrlSwitch)
This method uses to select all option in the multiselect list or unselect all option in the list, this method needs one argument and its boolean value, if give true, select all option in multiselect list or you give false value unselect all in multiselect list.
We create innovative projects, library files, online tools, and software for improving your work in software/web/mobile development. your can those project freely used.
No comments:
Post a Comment