【发布时间】:2017-06-18 17:42:06
【问题描述】:
所以我在使用 Material design 方面相当新,我在这里遇到了一个问题,我想在按下按钮时选中复选框或从多选下拉列表中选择多个选项,例如
如果我按下编辑按钮,它应该根据从数据库中获取的数据选中相应的框,并且数据正在以数组的形式接收。
当我按下编辑按钮时,应该选择具有值德里、古吉拉特邦等的数据。
when I press the edit button I receive this is data that I have console logged
Here is how I want for it to look before and after I press the button
我目前正在做的是:
$('#edit').on('click', function(){
$('[name="multiselect"]').val(data);
$('[name="multiselect"]').material_select();
});
【问题讨论】:
标签: javascript jquery material-design multi-select materialize