FORGEBOX Enterprise 🚀 - Take your ColdFusion (CFML) Development to Modern Times! Learn More...

PresideCMS Extension: MultiSelect Form Control for Preside applications

v1.2.5+0000082 Preside Extensions

Multi Select Form Control for Preside

Overview

This extension provides multi select form control with AJAX filtering functionality binding to Preside data objects.

Installation

box install preside-ext-multiselect

Ajax filtering setup

Sample usage for form field xml definition

<field name="parent_field_name" control="multiSelect" object="parent_db_object" filterChildId="related_child_select_field_name" ajax="/formcontrols/MultiSelect/refreshChildOptions/" extraClass="select-filter-by"/>

<field name="related_child_select_field_name"  control="multiSelect" object="child_db_object" filterBy="db_field_link_to_parent" objectFilters="activeOnly" />

Form attributes definition

Attribute nameValueUsage
controlmultiSelect
objectVariable: DB object name
filterChildId Required for parent field. This could be a list of child field names
ajax/formcontrols/MultiSelect/refreshChildOptions/Ajax URL to post to
extraClassselect-filter-byRequired for parent field.
filterByVariable: FK within child DB objectRequired for child field. FK within the child DB object that links to the parent table

Ajax type-to-search setup

Useful for select with huge list of options to limit a fix number of result on load, and type-to-search to bring up further matching options.

Sample usage for form field xml definition

<field name="field_with_long_options" control="multiSelect" ...  ajaxMaxRows="10" ajaxTextSearch="1" ajaxSearchCustomFilter="..." ajaxSearchUrl="..." />

Form attributes definition

Attribute nameValueUsage
controlmultiSelect
ajaxMaxRows/formcontrols/MultiSelect/refreshChildOptions/Max rows of options to be loaded (pre-selected values are not counted in this number)
ajaxTextSearch1Flag control to use Ajax text search
ajaxSearchCustomFilterfield_customAdditional form control ID for type-to-search custom filtering (other than filterChildId / filterBy relationship). Could be a comma-separated list
ajaxSearchUrl Custom type-to-search post URL - to be used together with ajaxSearchCustomFilter. If not specified, the default value is /formcontrols/MultiSelect/getObjectRecordsForAjaxSelectControl/

Changelog

v1.2.5

  • Fix an issue with UX on mobile

v1.2.4

  • Filter by field functionality is not being used by AJAX

v1.2.3

  • Deselect does not work correctly

v1.2.2

  • Backward compatibility fix: reinstate ext-multi-select sticker bundle asset

v1.2.1

  • Remove ajax type-to-search default url from cfrequest
  • Allow custom filter for type-to-search, used in pair with custom pixl8presideExtMultiselect.fn.updateChildSelect

v1.2.0

  • Update asset build (minifying assets)
  • Additional form control attributes: ajaxMaxRows, ajaxTextSearch, optional ajaxSearchUrl; load ajaxMaxRows of option list with type text search to retrieve relevant record options via ajax

v1.1.3

  • Create a dynamic allow list for ajax listing requests based on server-side requested form controls

v1.1.2

  • Fix issue with selected child option not updated on front-end

v1.1.1

  • Fix issue with extraneous markup in multiselct (additional closing tag)

v1.1.0

  • Add ability to limit the number of selectable options
  • Add a sortable option

v1.0.0

Initial release

$ box install preside-ext-multiselect

No collaborators yet.
     
  • {{ getFullDate("2017-07-17T05:10:20Z") }}
  • {{ getFullDate("2023-12-19T16:48:50Z") }}
  • 3,533
  • 95,264