How to select a list value via the directory in the modal window

In this article, we tell you how to select the field value for a form using the Falcon Space platform via a modal window with a table. 

The user clicks on the button, opens a modal window with a table, selects a value, and the selected row is loaded into the element.

How to make a similar mechanism: 

1. Adding a field of type select2 (List2) to the form. 

2. Specify its settings in getItem options_code1 (where code1 is the name of the field). 

-- SELECT 1
select '{"tags": true,
    "multiple":true,
    "table": {"code": "tables", "itemID": "32", "big": "1",
      "slideout": "2", "title": "Select a value"
    }
}' options_s47

Parameters: 

  • tags - allows you to enter new values from the keyboard in select (if this is not necessary, you can set false).
  • multiple - if true, you can select multiple values.
  • table - if an object is specified, a selection button from the modal table will be added. Its parameters: 
    • code - code of the called table in the system
    • itemID - id that allows you to filter the necessary data in the table (for example, to display only the orders of a specific user)
    • big, slideout, title - set the parameters of the modal window, as for ordinary modal tables-respectively, the window size, the method of appearance and the title of the modal window.

When you click on the table, you will add new elements to the select2 field or select an existing value.

The data-ItemId of the table row will be selected as the value value. The text is taken as the first of the fields that exist in the string name or title (i.e., use this name in such a table in advance if you plan to use this table to select values).

Falcon Space is a functional web development platform on a narrow stack MS SQL/Bootstrap. Falcon Space Gettting started
{sp-shortDemostandLinks}

SQL-tool for creating personal accounts on the site

The essence of the approach and the history of the creation of Falcon Space
Web platform for creating personal accounts

Falcon Space Platform

This is a reduction in the cost of ownership

at the expense of fewer people to support

This is a quick change

while using the program

This is a modern interface

full adaptation for mobile devices

MS SQL web applications. Affiliate program for developers and web studios

You can develop on your own or collaborate with us on Falcon Space web development using only SQL and HTML.
See examples with SQL code
Platform documentation
Working on MS SQL Server
Note