FormBuilder 编辑构建模板
FormBuilder edit build template
表单创建页面工作正常,但我需要表单编辑页面。我想我需要一个 att
但我没有找到。我该怎么做?
为管理面板呈现表单
enter image description here
var options = {
//GET DATA ...
}
var formBuilder = $(".form-create").formBuilder(options);
示例我的数据库行 (json)
{
“类型”:“header”,
“亚型”:“h1”,
"label":"\u003Ch2\u003E\u0130\u015f Ba\u015fvuru 公式\u003C/h2\u003E",
“访问”:假
},
{
“类型”:“文本”,
“必需”:假,
“标签”:“Ad\u0131n\u0131z Soyad\u0131n\u0131z”,
“类名”:“form-control”,
“名称”:“text-1629792064114-0”,
“访问”:假,
“子类型”:“文本”
},
{
“类型”:“文本”,
“必需”:假,
"label":"Do\u011fum 叶里",
“类名”:“form-control”,
“名称”:“text-1629792065034-0”,
“访问”:假,
“子类型”:“文本”
},
{
“类型”:“日期”,
“必需”:假,
“标签”:“Do\u011fum 塔里希”,
“类名”:“form-control”,
“名称”:“日期-1629792096274-0”,
“访问”:假
},
{
“类型”:“select”,
“必需”:假,
“标签”:“Cinsiyetiniz”,
“类名”:“form-control”,
"名称":"select-1629792210826-0",
“访问”:假,
“多个”:假的,
“价值观”:[
{
“标签”:“埃尔克”,
“价值”:“选项1”,
“selected”:真
},
{
“标签”:“K\u0131z”,
“价值”:“选项2”,
“selected”:假
},
{
"label":"选项3",
“价值”:“选项3”,
“selected”:假
}
]
},
{
“类型”:“文本”,
“必需”:假,
“标签”:“博尤努兹”,
“类名”:“form-control”,
“名称”:“text-1629792252737-0”,
“访问”:假,
“子类型”:“文本”
},
{
“类型”:“文本”,
“必需”:假,
“标签”:“基洛努兹”,
“类名”:“form-control”,
“名称”:“text-1629792262338-0”,
“访问”:假,
“子类型”:“文本”
},
{
“类型”:“按钮”,
“子类型”:“提交”,
“标签”:“按钮”,
"className":"btn-default btn",
“名称”:“按钮1629792543318-0”,
“访问”:假,
“风格”:“默认”
}
已解决:
var formData = jsondata ....;
var formBuilder = $(".form-create").formBuilder();
setTimeout(函数(){
formBuilder.actions.setData(formData);
},1500)
您需要 setTimeout(否则错误:formBuilder.actions.setData 不是函数)
表单创建页面工作正常,但我需要表单编辑页面。我想我需要一个 att 但我没有找到。我该怎么做?
为管理面板呈现表单
enter image description here
var options = {
//GET DATA ...
}
var formBuilder = $(".form-create").formBuilder(options);
示例我的数据库行 (json)
{ “类型”:“header”, “亚型”:“h1”, "label":"\u003Ch2\u003E\u0130\u015f Ba\u015fvuru 公式\u003C/h2\u003E", “访问”:假 }, { “类型”:“文本”, “必需”:假, “标签”:“Ad\u0131n\u0131z Soyad\u0131n\u0131z”, “类名”:“form-control”, “名称”:“text-1629792064114-0”, “访问”:假, “子类型”:“文本” }, { “类型”:“文本”, “必需”:假, "label":"Do\u011fum 叶里", “类名”:“form-control”, “名称”:“text-1629792065034-0”, “访问”:假, “子类型”:“文本” }, { “类型”:“日期”, “必需”:假, “标签”:“Do\u011fum 塔里希”, “类名”:“form-control”, “名称”:“日期-1629792096274-0”, “访问”:假 }, { “类型”:“select”, “必需”:假, “标签”:“Cinsiyetiniz”, “类名”:“form-control”, "名称":"select-1629792210826-0", “访问”:假, “多个”:假的, “价值观”:[ { “标签”:“埃尔克”, “价值”:“选项1”, “selected”:真 }, { “标签”:“K\u0131z”, “价值”:“选项2”, “selected”:假 }, { "label":"选项3", “价值”:“选项3”, “selected”:假 } ] }, { “类型”:“文本”, “必需”:假, “标签”:“博尤努兹”, “类名”:“form-control”, “名称”:“text-1629792252737-0”, “访问”:假, “子类型”:“文本” }, { “类型”:“文本”, “必需”:假, “标签”:“基洛努兹”, “类名”:“form-control”, “名称”:“text-1629792262338-0”, “访问”:假, “子类型”:“文本” }, { “类型”:“按钮”, “子类型”:“提交”, “标签”:“按钮”, "className":"btn-default btn", “名称”:“按钮1629792543318-0”, “访问”:假, “风格”:“默认” }
已解决:
var formData = jsondata ....;
var formBuilder = $(".form-create").formBuilder();
setTimeout(函数(){
formBuilder.actions.setData(formData);
},1500)
您需要 setTimeout(否则错误:formBuilder.actions.setData 不是函数)