BOS运行时-批量过滤条件表格-插件过滤条件

栏目:云星空知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

BOS运行时-批量过滤条件表格-插件过滤条件

1.列表的过滤页面包含普通条件过滤和高级过滤,高级过滤是一个整体控件,这个控件过滤有多种组合方式,对应BOS IDE控件如下:

image.webp

2.高级过滤设置过滤条件参考如下代码:

此代码演示了点击按钮时,设置单据编号字段批量属性:

using Kingdee.BOS.Core.CommonFilter;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel;
using Kingdee.BOS.Core.ListFilter;
using Kingdee.BOS.JSON;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cloud.BOS.Support.Filter
{
    [HotUpdate]
    [Description("高级过滤控件设置条件")]
    public class BatchFilterSetPlugin : AbstractListFilterPlugIn
    {
        
        public override void TreeNodeClick(TreeNodeArgs e)
        {
            SetBatchFilter();
        }

        public override void ButtonClick(ButtonClickEventArgs e)
        {
            if (e.Key.EqualsIgnoreCase("F_PIGM_Button"))
            {
                SetBatchFilter();
            }
        }
        private void SetBatchFilter()
        {
            JSONObject obj = new JSONObject();
            obj.Add("MakeUpType", "Column"); //列组合,行组合用Row
            obj.Add("Source", this.GetFilterRows());
            var baseBatchFilterGrid =this.View.GetControl(CommonFilterConst.ControlKey_BatchFilterGrid);
            if (baseBatchFilterGrid != null)
            {
                BatchFilterGrid batchFilterGrid = baseBatchFilterGrid as BatchFilterGrid;

                // 公共过滤可能没有这些面板,需要增加判断
                batchFilterGrid.SetFilterRowsWithMakeUpType(obj);
            }
        }

        private JSONArray GetFilterRows()
        {
            JSONArray rows = new JSONArray();
            rows.Add(FilterRows());
            return rows;
        }

        public JSONObject FilterRows()
        {
            JSONObject o = new JSONObject();
            o.Put("FieldName", "FBillNo");
            o.Put("Value", "[\"NO1\",\"NO2\",\"NO3\"]");
            o.Put("Logic", 0);
            return o;
        }
    }
}


3.点击按钮设置高级过滤效果如下:

image.webp

BOS运行时-批量过滤条件表格-插件过滤条件

1.列表的过滤页面包含普通条件过滤和高级过滤,高级过滤是一个整体控件,这个控件过滤有多种组合方式,对应BOS IDE控件如下:2.高级过滤设...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息