指定弹框的位置,这样就可以应用表单样式
this.form.getApp().appForm.node
```
var _self = this;
this.form.dialog({
"title": "填写内容",
"width": "400",
"height": "200",
"container" : this.form.getApp().appForm.node,
"moduleName": "label", //内容为表单上的组件,标识为div_1
"buttonList" : [
{
"type": "ok", //(string) 样式,彩色底的按钮
"text": "确定", //(string)text:按钮显示名称
"action": function(){ //(function) 按钮对应的点击事件
//do something,this指向本对话框对象
var value = _self.form.get("textfield").getData(); //获取div_1中的组件textfield的值
if( !value ){
_self.form.notice("请填写内容","info");
}else{
this.close();
}
}
},
{
"type": "cancel", //(string) 样式,灰色底的按钮
"text": "取消",
"action": function(){
//do something
this.close();
}
}
]
});
```
评论