From 7184c701a40d91837f00f13b2dd63e0343e33d42 Mon Sep 17 00:00:00 2001 From: omski Date: Thu, 20 Jan 2022 19:03:02 +0100 Subject: [PATCH] added missing validation output for select element to grid create and update component (#328) added number input type Co-authored-by: gsuchomski --- GridBlazor/Pages/GridCreateComponent.razor | 14 ++++++++++++-- GridBlazor/Pages/GridUpdateComponent.razor | 14 ++++++++++++-- GridShared/Columns/InputType.cs | 5 ++++- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/GridBlazor/Pages/GridCreateComponent.razor b/GridBlazor/Pages/GridCreateComponent.razor index 64b6d283..c0526b56 100644 --- a/GridBlazor/Pages/GridCreateComponent.razor +++ b/GridBlazor/Pages/GridCreateComponent.razor @@ -52,7 +52,7 @@ else { var selectedValue = column.GetFormatedValue(value); - @foreach (var selectItem in ((IGridColumn)column).SelectItems) { @@ -66,6 +66,9 @@ } } + + @ColumnErrors.Get(column.FieldName) + } } else if (((IGridColumn)column).IsSelectColumn.IsSelectKey) @@ -78,7 +81,7 @@ else { var selectedValue = column.GetFormatedValue(value); - @{ var selectItems = SelectItems.Get(column.Name); @@ -98,6 +101,9 @@ } } + + @ColumnErrors.Get(column.FieldName) + } } else @@ -275,6 +281,10 @@ } } } + else if (((IGridColumn)column).InputType == InputType.Number) + { + + } else { diff --git a/GridBlazor/Pages/GridUpdateComponent.razor b/GridBlazor/Pages/GridUpdateComponent.razor index b9b543f7..f8024bce 100644 --- a/GridBlazor/Pages/GridUpdateComponent.razor +++ b/GridBlazor/Pages/GridUpdateComponent.razor @@ -56,7 +56,7 @@ else { var selectedValue = column.GetFormatedValue(value); - @foreach (var selectItem in ((IGridColumn)column).SelectItems) { @@ -70,6 +70,9 @@ } } + + @ColumnErrors.Get(column.FieldName) + } } else if (((IGridColumn)column).IsSelectColumn.IsSelectKey) @@ -82,7 +85,7 @@ else { var selectedValue = column.GetFormatedValue(value); - @{ var selectItems = SelectItems.Get(column.Name); @@ -102,6 +105,9 @@ } } + + @ColumnErrors.Get(column.FieldName) + } } else @@ -274,6 +280,10 @@ } } } + else if (((IGridColumn)column).InputType == InputType.Number) + { + + } else { diff --git a/GridShared/Columns/InputType.cs b/GridShared/Columns/InputType.cs index 974d9d2b..ce72513a 100644 --- a/GridShared/Columns/InputType.cs +++ b/GridShared/Columns/InputType.cs @@ -10,7 +10,8 @@ public enum InputType DateTimeLocal, Week, Month, - File + File, + Number } public static class InputTypeExtensions @@ -33,6 +34,8 @@ public static string ToTypeAttr(this InputType me) return "month"; case InputType.File: return "file"; + case InputType.Number: + return "number"; default: return ""; }