public override Action <IRendererTreeBuilder> BuildBodyRendererTree( CreateItemRendererContext <TModel> createItemRendererContext, IFormInputRendererTreeProvider formInputRendererTreeProvider) { return(builder => { var fields = createItemRendererContext.GetModelFields().ToList(); builder.OpenElement(HtmlTagNames.Div, "center-block"); for (int i = 0; i < fields.Count; i = i + ColumnsCount) { builder.OpenElement(HtmlTagNames.Div, "form-group row"); var rowFields = fields.Skip(i).Take(ColumnsCount); foreach (var field in rowFields) { BuildFormFieldRendererTree(field, createItemRendererContext, formInputRendererTreeProvider)?.Invoke(builder); } builder.CloseElement(); } builder.CloseElement(); }); }
public override Action <IRendererTreeBuilder> BuildBodyRendererTree( CreateItemRendererContext <TItem> createItemRendererContext, AbstractEditInputRenderer editInputRenderer) { return(builder => { builder.OpenElement(HtmlTagNames.Div, "center-block"); foreach (var field in createItemRendererContext.GetModelFields()) { BuildFormFieldRendererTree(field, createItemRendererContext, editInputRenderer)?.Invoke(builder); } builder.CloseElement(); }); }
public override Action <IRendererTreeBuilder> BuildBodyRendererTree( CreateItemRendererContext <TModel> createItemRendererContext, // todo - add wrapped properties to this with annotation info IFormInputRendererTreeProvider formInputRendererTreeProvider) { return(builder => { builder.OpenElement(HtmlTagNames.Div, "center-block"); foreach (var field in createItemRendererContext.GetModelFields()) { //var configProperty = entityType.FindProperty(field.Name); //if(configProperty == null || configProperty.IsEditable) BuildFormFieldRendererTree(field, createItemRendererContext, formInputRendererTreeProvider, field.Name)?.Invoke(builder); } builder.CloseElement(); }); }