public override void OnSetLayoutInfo(SetLayoutInfoArgs e) { base.OnSetLayoutInfo(e); // 获取单据体表格的元数据及布局 string entityKey = "FEntity"; //Entity entity = _currBusinessInfo.GetEntity(entityKey); EntityAppearance entityApp = _currLayoutInfo.GetEntityAppearance(entityKey); Entity entity = entityApp.Entity; var textApp = _currLayoutInfo.GetFieldAppearance("FField"); var decimalApp = _currLayoutInfo.GetFieldAppearance("FDecimal"); for (int i = 0; i < entityData.Columns.Count; i++) { string name = "FField_" + (i + 1).ToString(); //FieldAppearance field = new FieldAppearance(); FieldAppearance field; if (i == 0) { field = (FieldAppearance)ObjectUtils.CreateCopy(textApp); } else { field = (FieldAppearance)ObjectUtils.CreateCopy(decimalApp); //添加合计列 GroupSumColumn sumColumn = new GroupSumColumn(); sumColumn.FieldKey = name; sumColumn.Precision = -1; sumColumn.SumType = 1; entity.GroupColumnInfo.AddGroupSumColumn(sumColumn); } field.Key = name; field.Caption = new LocaleValue(entityData.Columns[i].ColumnName); field.Field = _currBusinessInfo.GetField(name); field.Tabindex = i + 1; _currLayoutInfo.Add(field); } _currLayoutInfo.Remove(textApp); _currLayoutInfo.Remove(decimalApp); entityApp.Layoutinfo.Sort(); e.LayoutInfo = _currLayoutInfo; EntryGrid grid = this.View.GetControl <EntryGrid>("FEntity"); grid.SetCustomPropertyValue("AllowLayoutSetting", false); grid.CreateDyanmicList(_currLayoutInfo.GetEntityAppearance("FEntity")); this.View.SendDynamicFormAction(this.View); }
public override void OnSetLayoutInfo(SetLayoutInfoArgs e) { // 用来放置动态创建字段的容器面板:需提前在单据上设计好此面板 Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel.Container parentPanel = this.View.GetControl <Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel.Container>("F_WJ_Panel"); // 布局对象:需要把新字段加入到布局对象中,然后再把布局对象添加到面板中 panelLayout = new LayoutInfo(); // 取模板字段的外观布局对象,仿照外观 modelTextFieldApp = this.View.LayoutInfo.GetFieldAppearance("FModelText"); modelF8FieldApp = this.View.LayoutInfo.GetFieldAppearance("FModelF8") as BaseDataFieldAppearance; modelDecimalFieldApp = this.View.LayoutInfo.GetFieldAppearance("FModelDecimal") as DecimalFieldAppearance; modelAssistantFieldApp = this.View.LayoutInfo.GetFieldAppearance("FModelAssistant") as AssistantFieldAppearance; presenter.LayoutByExtensons(); // 把layout加入到容器面板中 parentPanel.AddControls(panelLayout); e.LayoutInfo = _currLayoutInfo; e.BillLayoutInfo = _currLayoutInfo; this.View.SendDynamicFormAction(this.View); base.OnSetLayoutInfo(e); }
public override void OnSetLayoutInfo(SetLayoutInfoArgs e) { base.OnSetLayoutInfo(e); }