ckanext-scheming icon indicating copy to clipboard operation
ckanext-scheming copied to clipboard

How to implement tag-like autocomplete for large select choice lists?

Open florianm opened this issue 10 years ago • 2 comments

Using the select widget with its choices defined in the custom schema becomes a performance issue for large lists of choices, as they are fully loaded when the dataset edit form is rendered. E.g., 2000 lines of geojson for the spatial snippet will significantly slow down the read view.

@wardi could you point me in the right direction: Is there an elegant way to provide an autocompleting box (like the tag snippet) for custom lists of label:value pairs?

florianm avatar Aug 20 '15 04:08 florianm

There are a couple problems: the first is that that rendering all the options in the form is slow, the second is that enumerating all the options in a schema or preset really bloats the json/yaml file.

We're addressing both of these issues and allowing certain users to edit the list of available values by defining a new type for our code lists and providing an autocomplete api call to drive JS in the form.

We don't have anything generic and reusable yet. @TkTech @mattleduc @thriuin is there something we can point @florianm to in ckanext-stcndm that would provide some more information? I think it would be great if some of this functionality (validatiors, form snipptes, examples) could be moved to ckanext-scheming because it's super-useful.

wardi avatar Aug 23 '15 17:08 wardi

@marcfor This is what we spoke about recently.

wardi avatar Mar 18 '16 12:03 wardi