阅读:2528
回复:6
|
子表自动加载数据 |
1楼#
发布于:2017-05-25 19:31
看这个帖子
http://bbs.h3bpm.com/read.php?tid=2175&fid=8 他的代码里面就有用到这个,你可以下载来看看。 或者看这个帖子 http://bbs.h3bpm.com/read.php?tid=2104&fid=8&page=1#10122 |
|
2楼#
发布于:2017-05-26 08:44
public override MvcViewContext LoadDataFields()
{ if (this.ActionContext.IsOriginateMode) { BizObject[] bizObjects = new BizObject[数组长度]; BizObjectSchema childSchema = this.ActionContext.Schema.GetProperty("子表编码").ChildSchema; for (int i = 0; i < DataTable0.Rows.Count; i++) { bizObjects = new BizObject(this.ActionContext.Engine, childSchema, this.ActionContext.User.UserID); bizObjects["字段编码"] = ""; bizObjects["字段编码"] = ""; } this.ActionContext.InstanceData["子表编码"].Value = bizObjects; } return base.LoadDataFields(); } 使用上述方法,DataTable0是一个数据集?,这个方法如何编写,如何循环数据集,一行行遍历获取数据@t156965365 |
|
3楼#
发布于:2017-05-26 09:08
|
|
4楼#
发布于:2017-05-27 11:24
方法二:
或者使用后台处理数据的方式 复制代码 // 执行后台事件 $.MvcSheet.Action( { Action: "TestAction", // 后台方法名称 Datas: ["输入参数"], // 输入参数,格式 ["{数据项名称}","String值","控件ID"],当包含数据项名称时 LoadControlValue必须为true LoadControlValue: true, // 是否获取表单数据 PostSheetInfo: true, // 是否获取已经改变的表单数据 OnActionDone: function (e) { // 执行完成后回调事件 } } 其中后台方法名称是指业务集成-业务服务-业务列表的方法名称?@t156965365 @H3BPM @岩竹玉雨 |
|
5楼#
发布于:2017-05-27 11:42
bpmh3:方法二:http://bbs.h3bpm.com/read.php?tid=2175&fid=8&page=2#read_10423 |
|
6楼#
发布于:2017-05-27 17:11
public override MvcViewContext LoadDataFields()
{ if (this.ActionContext.IsOriginateMode) { BizObject[] bizObjects = new BizObject[4]; BizObjectSchema childSchema = this.ActionContext.Schema.GetProperty("SchedulePlan").ChildSchema; string pbtid = "ba7a3cb8-1558-49f3-93f8-184a807c9532";//Request.QueryString["pbtid"]; // string sql = "select pcs_id,pcs_slmc,pcs_unit,pcs_num,pcs_gg,pcs_jssq from dbo.Project_CGSQ_Sub where pcm_id='" + id + "'"; StringBuilder sql = new StringBuilder(); sql.Append("Select ObjectID, PNo, PName "); sql.Append("From I_PeopleCharge "); sql.Append("Where ParentObjectID ='" + pbtid + "' and 1=1 "); DataTable dt = OThinker.H3.WorkSheet.AppUtility.Engine.EngineConfig.CommandFactory.CreateCommand().ExecuteDataTable(sql.ToString()); for (int i = 0; i < dt.Rows.Count; i++) { bizObjects = new BizObject(this.ActionContext.Engine, childSchema, this.ActionContext.User.UserID); bizObjects["SchedulePlan.StepID"] = dt.Rows["PNo"].ToString(); bizObjects["SchedulePlan.StepName"] = dt.Rows["PName"].ToString(); } this.ActionContext.InstanceData["SchedulePlan"].Value = bizObjects; } return base.LoadDataFields(); } } 出现表单数据加载失败?@t156965365 |
|