单据体行删除后,保留过滤条件
单据体快速过滤后删除行会清空,可以在单据上注册表单插件,实现删除行后保留过滤条件。
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); } } }
单据体行删除后,保留过滤条件
单据体快速过滤后删除行会清空,可以在单据上注册表单插件,实现删除行后保留过滤条件。using Kingdee.BOS.Core.DynamicForm.PlugIn; using...
点击下载文档
上一篇:轻分析,不可遗漏的展示神器下一篇:反写插件
本文2024-09-16 17:39:07发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-17074.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章