Rendering other select based on checkbox event


Topic: Rendering other select based on checkbox event

dipeshshah asked 2 years ago

We are trying to re-generate select based on other checkbox event, but when we select multiple checkbox (more than 4) it becomes slow.

Below is the code for reference

function setDdlDefaultStore(){
        $('#ddlDefaultStore').find('option:enabled').remove();
        $('#ddlStores').closest('div.row').find('li').each(function(){             
            if($(this).hasClass('active')){
                $('#ddlDefaultStore').append('<option>'+$(this).find('span').text()+'</option>');
            }
        });
        $('#ddlDefaultStore').materialSelect();            
    }

Piotr Glejzer staff commented 2 years ago

Did you try to use buildMaterialOptions method or buildSingleOption method to do this?


dipeshshah commented 2 years ago

No, let me try. Do we have any documentation for such methods?


Piotr Glejzer staff commented 2 years ago

we don't have any documentation for this :( you have to find this in material-select.js file and do it for your own what you want.


Please insert min. 20 characters.