Skip to content

JavaScript Picker

The jSuites.picker is a responsive JavaScript plugin designed for easy option selection within web applications. Key features include its adaptability to different screen sizes, a user-friendly interface, customization capabilities, lightweight design for fast performance, and broad compatibility across browsers and devices.

MethodDescription
getLabel(int);Return the option at the specified position
@param - element index
open();Open the picker
close();Closes the picker
getValue();Returns the index corresponding to the current selected element
setValue(int);Define the option at the specified position as the picker value

The order of the onchange methods has changed from 4.2.0

MethodDescription
onchangeWhen the value is changed
onchange(DOMElement element, Object instance, String value, String value, Number selectIndex) => void
oncloseWhen the picker is closed
onclose(DOMElement element, Object instance) => void
onopenWhen the picker is open
onopen(DOMElement element, Object instance) => void
PropertyDescription
data: string[]The picker options.
value: intThe position of the initial picker option.
content: stringThe html or material-design icon that should be in front of the picker.
width: numberThe picker width.
render: functionHow each option should be shown.
function(string option) => string
<html>
<script src="https://jsuites.net/v6/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v6/jsuites.css" type="text/css" />

<div class='row'>
    <div class='column p10'>
        <div id='picker'></div>
    </div>
</div>

<script>
  jSuites.picker(document.getElementById('picker'), {
    data: ['Option1', 'Option2', 'Option3'],
    value: 3,
  })
</script>
</html>