单据体行删除后,保留过滤条件

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

单据体行删除后,保留过滤条件

单据体快速过滤后删除行会清空,可以在单据上注册表单插件,实现删除行后保留过滤条件。

using Kingdee.BOS.Core.DynamicForm.PlugIn; using Kingdee.BOS.Core.DynamicForm.PlugIn.Args; using Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel; using Kingdee.BOS.JSON; using Kingdee.BOS.Util; using System.Collections.Generic; namespace Test24.PlugIns.BL {     [Kingdee.BOS.Util.HotUpdate]     public class KeepEntityFilterPlugIn : AbstractDynamicFormPlugIn     {         Dictionary<string, string> filterStrings = new Dictionary<string, string> { };         public override void CustomEvents(CustomEventsArgs e)         {             if (e.EventName == "FilterChanged")             {                 var dict = JsonUtil.DeserializeObject<Dictionary<string, object>>(e.EventArgs);                 var filterString = dict["FilterString"].ToString();                 filterStrings[e.Key.ToUpper()] = filterString;             }             else if (e.EventName == "RecoverFilterString")             {                 EntryGrid grid = this.View.GetControl(e.Key.ToUpper()) as EntryGrid;                 var dict = JsonUtil.DeserializeObject<Dictionary<string, object>>(e.EventArgs);                 var filterString = dict["FilterString"].ToString();                 grid.SetFilterString(filterString);             }         }         public override void AfterDeleteRow(AfterDeleteRowEventArgs e)         {             if (!filterStrings.ContainsKey(e.EntityKey.ToUpper())) return;             var para = new JSONObject();             para["key"] = e.EntityKey.ToUpper(); // 自定义事件标识             para["eventName"] = "RecoverFilterString"; // 要触发的事件名称             para["delay"] = "50"; // 延迟触发间隔(单位毫秒)             var data = new JSONObject();             data["FilterString"] = filterStrings[e.EntityKey.ToUpper()];             para["data"] = data; // 自定义事件携带的数据包             this.View.AddAction("fireCustomRequest", para);         }     } }

image.webp



image.webp



单据体行删除后,保留过滤条件

单据体快速过滤后删除行会清空,可以在单据上注册表单插件,实现删除行后保留过滤条件。using Kingdee.BOS.Core.DynamicForm.PlugIn; using...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息