我使用Froala,我被卡住创建自定义下拉动态选项设置。我用他们常用的方法来创建下拉菜单,但如果我们必须从db中获取值,那就没用了。Froala编辑器动态值自定义下拉
我想用一个“模板”下拉菜单中的10个选项来选择哪个将被动态创建。
目前,我们创建一个自定义下拉这样,
options: {
'Template One': function(e){
_this.editable('insertHTML', "<p>This is template one</p>", true);
},
}
我想这是动态的,这意味着我将获取的名称和来自数据库的模板内容和设置相应的选项添加。
类似,
options : {
$.each(alltemplates, function(i, h){
i: function(e){ /// "i" will be the name of the template fetched from db
_this.editable('insertHTML', h, true); // h is the html fetched from db
},
})
}
,这将降低动态创建的下降。请帮忙吗?