Select field type

Select field type

mbparkermbparker Posts: 3Questions: 1Answers: 0

Hello. I'm using the latest versions of Datatables and Editor. I am using inline editing and have a Select field type that allows multiple selections. How do I get it to pre-select the already selected items when it drops down for edit?

Additionally, there are hundreds of values in this select list. I need to allow it to be filtered. What is the recommended way of adding a filter to the top of a Select editor?

Thanks,
Matt

Answers

  • mbparkermbparker Posts: 3Questions: 1Answers: 0

    Disregard the question about pre-selecting values - it works automatically when you put in the correct field name. :-)

  • mbparkermbparker Posts: 3Questions: 1Answers: 0

    I figured it out, but it doesn't seem like the right way to do it:

    ...
    var searchableListInitialized = false;

        editor.on('preOpen', function(e, mode, action) {
    
            if (!searchableListInitialized) {
    
                var field = editor.field('ProjectIterationIds');
                $('select', field.node()).addClass('selectpicker');
                $('select', field.node()).attr('data-live-search', 'true');
    
                window.setTimeout(function() {
                    $('.selectpicker').selectpicker({
                        width: '100%',
                        size: 5
                    });
                }, 100);
    
                searchableListInitialized = true;
            }
    
            return true;
        });
    

    ...

This discussion has been closed.