泛微E9开发 查询页面添加按钮,完成特定功能

1、关联知识(查询页面实现新增按钮)

泛微E9开发 如何在查询页面新增按钮,通过按钮新建指定流程

2、功能实现

2.1. 点击按钮,输出选中的checkbox的值

 	var a=_xtable_CheckedCheckboxId();
    var ids = ModeList.getCheckedID();
    var detailDws = ModeList.getCheckedIDWithDetail();
    console.log(`a=${a}`);
    console.log(`ids=${ids}`);
    console.log(`detailDws=${detailDws}`);

控制台输出
在这里插入图片描述

2.2. 点击按钮,打开一个自定义对话框

 	//此方法用来打开一个自定义对话框
    //如果是内部iframe里定义的方法,直接写方法名,外部添加代码块方式添加的方法,需要在方法名前面加上base.
    let buttons=[{btnname:'保存',callfun:'base.saveDialog'},
                {btnname:'新建',callfun:'base.add'},
                {btnname:'关闭',callfun:'base.closeDialog'}];
    let style={width:300,height:600};
    let prop={title:'测试jsp',url:'',style:style};
    ModeForm.openCustomDialog(prop,buttons)

自定义对话框样式
在这里插入图片描述

3、实现方法

  1. 通过【后端】-【建模引擎】-【模块】,找到模块后,选择【页面扩展】,新建一个页面扩展
    在这里插入图片描述
  2. 设置好页面扩展内容后,保存。
  3. 找到该模块对应的查询界面,插入以下代码块。
<script type="text/javascript">
  
  function saveDialog(){
    console.log("saveDialog");
  }
  
  function add(){
    console.log("add");
  }

  function closeDialog(){
    console.log("closeDialog");
    parent.ModeForm.closeCustomDialog();   //此方法用来关闭一个自定义对话框
  }
  
  function onTest(){
    var a=_xtable_CheckedCheckboxId();
    var ids = ModeList.getCheckedID();
    var detailDws = ModeList.getCheckedIDWithDetail();
    console.log(`a=${a}`);
    console.log(`ids=${ids}`);
    console.log(`detailDws=${detailDws}`);
    
    //此方法用来打开一个自定义对话框
    //如果是内部iframe里定义的方法,直接写方法名,外部添加代码块方式添加的方法,需要在方法名前面加上base.
    let buttons=[{btnname:'保存',callfun:'base.saveDialog'},
                {btnname:'新建',callfun:'base.add'},
                {btnname:'关闭',callfun:'base.closeDialog'}];
    let style={width:300,height:600};
    let prop={title:'测试jsp',url:'',style:style};
    ModeForm.openCustomDialog(prop,buttons)
  }

</script>
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

进击的巨无霸汉堡

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值