Пример #1
0
        private void CreateWidgets(FormContext formContext, BaseField fieldInfo, FilterExpField filterField = null)
        {
            formContext.AddEntityModelInfo("FieldName", fieldInfo.Name);

            formContext.AddControl(AddFieldName(formContext, fieldInfo));

            var widgetContext = new WidgetContext(formContext);

            widgetContext.Build(fieldInfo, new TField()
            {
                FieldId = "Field"
            });
            widgetContext.IsRequired = false;
            widgetContext.Validation = null;

            var widget = WidgetFactory.Create(widgetContext);

            widget.OnCompile();
            if (filterField != null)
            {
                widget.SetValue(filterField.Value);
            }
            formContext.AddControl(widget);

            AddOperationField(formContext, fieldInfo, filterField);
        }