Skip to content

Editable List

Screenshot

Displays an editable list of string key/value pairs in a table format or dropdown menu. Pair it with other components such as Data Filter or Visual Query Builder to easily manipulate those components' JSON string states.

Set up

  1. Define the data source used to store the key/value pairs in the editable list. An update query must be used on a keyed table.

  2. Set the Selected Key to a view state to map the currently selected key from the editable list.

  3. Set the Selected Value to a string view state to map the currently selected string value from the editable list.

Basics

Screenshot

Data Source

This must be set to an update query on a keyed table, used for storing the editable list of key/value pairs.

Screenshot

Update query:

{[dgAdd;dgUpd;dgDel]

/this sample requires keyed table:
/ table's key matches 'Key' in this dialog
/exampleQueries:: `id xkey ([] id:`int$();name:`symbol$();note1:`symbol$());
/ `exampleQueries upsert(0i;`dummy;`);

    if[count[dgUpd]>0;`screenerFilters upsert flip dgUpd];
    if[count[dgDel]>0;
        delete from `screenerFilters where id in (dgDel[`id])];

    /generate unique ids for new items
    if[count[dgAdd]>0;`screenerFilters upsert flip dgAdd];
}

Data sources

Dropdown
Displays JSON options in a dropdown
Selected Key
A view state parameter assigned to the dropdown, determines which JSON list is selected
Selected Value

A second view state parameter, of type string, which stores the Selected Key JSON.

Screenshot

Vertical
Positions the Editable list within the component
Show New
When enabled, user can create new key/value pairs in the editable list
Show Save
User can save new key/value pairs that have been added to the editable list
Show Delete
User can remove unwanted key/value pairs from the editable list
Prompt to Save
When enabled, any changes made by a user will prompt a save request
Confirm Before Deleting
When enabled, any deleted list will require confirmation from the user.
Template

For building a custom layout of an Editable list

Screenshot

Format, Margins

Style for common style settings