Skip to content

Listselect Renderer

Tobias Paczian edited this page Mar 29, 2018 · 1 revision

image

Provides a select list that allows the selection of one or multiple data items that can be filtered by their attributes. The attribute to be filtered will be displayed as the label in the selection list. Filters can be chained by pressing the enter key in the filter box.

options

  • target (HTML Container Element) - Element to render in.
  • data (ARRAY of objects) - The data to display.
  • multiple (BOOLEAN) - If set to false, displays a single select vs a multi select. Default is false.
  • no_button (BOOLEAN) - If set to true, does not display submit button (callback triggers on change event). Default is false.
  • rows (INT) - The number of rows to display in the select list. Default is 10.
  • sort (BOOLEAN) - Setting this to true will automatically sort the lists by the currently selected filter. Default is false.
  • filter (ARRAY of STRING) - An ordered list of attribute names that are attributes of the objects passed in data that the selection list may be filtered by
  • keyMapping (HASH) - A hash where they keys are the filter display names and the value is the actual object attribute name
  • filter_value (STRING) - Initial value of the filter. Default is ``null`.
  • filter_attribute (STRING) - Initial attribute to be displayed and filtered by. Default is the first element in the filter list.
  • filter_type (STRING) - One of [ prefix, infix, strict ]. Default is infix
  • no_filter (BOOLEAN) - If set to true, hides the filter. Default is false.
  • result_field (BOOLEAN) - If set to true, shows a text input field to name the result. Default is false.
  • result_field_default (STRING) - Default string to put into the result field. Default is null.
  • result_field_placeholder (STRING) - Placeholder text for the result field. Default is selection name.
  • select_name (STRING) - Name attribute of the result listselect. Default is selection.
  • select_id (STRING) - ID attribute of the result listselect. Default is selection.
  • value (STRING) - The attribute of the data objects to be used as the value of the select options.
  • callback (FUNCTION) - The function to be called when the submit button is pressed. This function will pass the values of the selected option(s).
  • selection (HASH of STRING) - Hash of values pointing to 1. The inital selection in the result box. The values must be attribute values of the data object attribute selected as the value attribute of the selection list.
  • button (OBJECT) - This allows setting of the class, style, text and icon attributes of the button, i.e. { class: 'btn btn-error', style: 'border: 1px dotted black;', icon: '<i class="icon-ok icon-white"></i>', text: 'search' }
  • synchronous (BOOLEAN) - This is true by default. If set to false, the listselect expects its data to be set, filtered and browsed externally. It will issue a callback to the navigation callback function on any of those events, expecting an external data update.
  • navigation_callback (FUNCTION) - The function to be called when a navigation / filter action is issued and the listselect is in asynchronous state (synchronous set to false). It will be passed either a string (more, reset) or an object that can contain one of the following structures:
    { query: [ { searchword: $filter_value, field: $column_name_to_search, comparison: $comparison_operator }, ... ] }
    { limit: $number_of_rows_per_page }
  • asynch_limit (INTEGER) - The number of items initially loaded in asynchronous mode, default is 100.
  • asynch_filter_min_length (INTEGER) - The number of characters that need to be entered into the filter before the filter callback is performed. Default is 3.
  • asynch_keystroke_threshold (INTEGER) - The number of miliseconds in between keystrokes the navigation callback method will wait for new keystrokes before sending the full request. Default is 1000 (one second).
  • data_manipulation (FUNCTION) - function to manipulate asynch data after it was retrieved and before it was rendered. Gets the data passed as an argument.

Clone this wiki locally