This code snippet utilizes the jQuery library to initialize a dual select box with the Bootstrap Dual Listbox plugin.

The '$('.dual_select')' selector targets the HTML element bearing the 'dual_select' class.

The 'bootstrapDualListbox()' function is invoked on this element to set up the dual select box using the supplied options:

  • 'nonSelectedListLabel' defines the label for the non-selected list.
  • 'selectedListLabel' defines the label for the selected list.
  • 'preserveSelectionOnMove' determines whether the selection is maintained when an item is moved. The value 'moved' ensures selection preservation upon item movement.
  • 'moveOnSelect' dictates whether the selected item is moved immediately after selection. If set to 'false', an arrow will appear, indicating single-item selection at a time.
  • 'filterTextClear' specifies the text for the clear filter button.
  • 'moveSelectedLabel' defines the label for the move selected button.
  • 'moveAllLabel' defines the label for the move all button.
  • 'removeSelectedLabel' defines the label for the remove selected button.
  • 'removeAllLabel' defines the label for the remove all button.
  • 'infoText' defines the text format for displaying information about the number of items.
  • 'showFilterInputs' determines whether to display filter inputs for searching.
  • 'selectorMinimalHeight' specifies the minimum height of the selector boxes.

The result is a dual select box with the specified labels, buttons, and options.


原文地址: http://www.cveoy.top/t/topic/pFmP 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录