操作列插件设置可见性和锁定性

栏目:云苍穹知识作者:金蝶来源:金蝶云社区发布:2024-09-23浏览:1

操作列插件设置可见性和锁定性

应用场景

插件需要动态控制操作列的显示和隐藏的情况,一般是状态变化后更新操作列。



功能介绍


1.    单据体上操作列控制列的显示与隐藏实例代码


Ø  值更新的情况下进行控制

public void propertyChanged(PropertyChangedArgs propertychangedargs) {

        this.getView().showMessage("title", "content", MessageTypes.Commit);

        EntryGrid entryGrid = this.getControl("entryentity");

        List<String> opeIds = new ArrayList<>();

        opeIds.add("view");

        entryGrid.hideOperateItems("operationcolumnap", 0, opeIds);

       this.getView().showMessage(propertychangedargs.getChangeSet().toString());

}


Ø  初始加载时控制显示与隐藏

@Override

public void initialize() {

        EntryGrid entryGrid = this.getControl("entryentity");

        entryGrid.addPackageDataListener(pkEvent -> {

               Object status = pkEvent.getRowData().get("status");

               if (pkEvent.getSource() instanceof OperationColumn

                             && "operationcolumnap".equalsIgnoreCase(((OperationColumn) pkEvent.getSource()).getKey())) {

                      List<OperationColItem> operationColItems = (List<OperationColItem>) pkEvent.getFormatValue();

                      for (OperationColItem operationColItem : operationColItems) {

                             //

                             if ("audit".equalsIgnoreCase(operationColItem.getOperationKey()) && status == "审核") {

                                    operationColItem.setVisible(false);

                                    operationColItem.setLocked(true);

                             }

                      }

               }

        });

        super.initialize();

}



2.    列表上操作列设置可见性示例代码

@Override

public void initialize() {

        EntryGrid entryGrid = this.getControl("entryentity");

        entryGrid.addPackageDataListener(pkEvent -> {

               Object status = pkEvent.getRowData().get("status");

               if (pkEvent.getSource() instanceof OperationColumn

                             && "operationcolumnap".equalsIgnoreCase(((OperationColumn) pkEvent.getSource()).getKey())) {

                      List<OperationColItem> operationColItems = (List<OperationColItem>) pkEvent.getFormatValue();

                      for (OperationColItem operationColItem : operationColItems) {

                             //

                             if ("audit".equalsIgnoreCase(operationColItem.getOperationKey()) && status == "审核") {

                                    operationColItem.setVisible(false);

                                    operationColItem.setLocked(true);

                             }

                      }

               }

        });

        super.initialize();

}




相关链接

开发服务云新特性发布汇总

https://club.kdcloud.com/article/76619783260443136


操作列插件设置可见性和锁定性

应用场景插件需要动态控制操作列的显示和隐藏的情况,一般是状态变化后更新操作列。功能介绍1. 单据体上操作列控制列的显示与隐藏实例...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息