From f5cce95a4ed5fe401f3ca8373a13e6c736c13473 Mon Sep 17 00:00:00 2001 From: Gustau Navarro Date: Sat, 26 Mar 2022 13:26:49 +0100 Subject: [PATCH] Update documentation --- docs/blazor_client/Events.md | 9 +++++++++ docs/blazor_local/Events.md | 9 +++++++++ docs/blazor_odata/Events.md | 9 +++++++++ docs/blazor_server/Events.md | 9 +++++++++ docs/dotnetcore_blazor/Events.md | 9 +++++++++ 5 files changed, 45 insertions(+) diff --git a/docs/blazor_client/Events.md b/docs/blazor_client/Events.md index 09add672..b0a4f539 100644 --- a/docs/blazor_client/Events.md +++ b/docs/blazor_client/Events.md @@ -215,6 +215,15 @@ Notice that all handlers must be async. In this sample ```OrderValidator``` is a class that validates the ```Order``` object to be modified. If it's a valid item the event returns ```true```. If the item is not valid the event writes an error on the form and returns ```false```. +## Default CRUD data annotations validation + +GridBlazor validates by default all data annotations defined with attributes on the the model. This validation happens for Create and Update standard forms. If you use custom CRUD forms this will depend on your code. + +If you want to use custom validator classes on standard CRUD form, you can disable the default data annotation validation to avoid validators collisions. +It can be disabled using the ```SetDataAnnotationsValidation``` method of the ```GridClient``` object. +An then you have to configure your custom validators using the ```BeforeInsert```, ```BeforeUpdate``` and ```BeforeDelete``` events. + + ## Events for subgrids and nested CRUD subgrids If you want to define events for a subgrid and/or a nested CRUD subgrid you must handle in the ```OnAfterRender``` method of the subgrid component. diff --git a/docs/blazor_local/Events.md b/docs/blazor_local/Events.md index 78443869..8d231d2e 100644 --- a/docs/blazor_local/Events.md +++ b/docs/blazor_local/Events.md @@ -212,6 +212,15 @@ Notice that all handlers must be async. In this sample ```OrderValidator``` is a class that validates the ```Order``` object to be modified. If it's a valid item the event returns ```true```. If the item is not valid the event writes an error on the form and returns ```false```. +## Default CRUD data annotations validation + +GridBlazor validates by default all data annotations defined with attributes on the the model. This validation happens for Create and Update standard forms. If you use custom CRUD forms this will depend on your code. + +If you want to use custom validator classes on standard CRUD form, you can disable the default data annotation validation to avoid validators collisions. +It can be disabled using the ```SetDataAnnotationsValidation``` method of the ```GridClient``` object. +An then you have to configure your custom validators using the ```BeforeInsert```, ```BeforeUpdate``` and ```BeforeDelete``` events. + + ## Events for subgrids and nested CRUD subgrids If you want to define events for a subgrid and/or a nested CRUD subgrid you must handle in the ```OnAfterRender``` method of the subgrid component. diff --git a/docs/blazor_odata/Events.md b/docs/blazor_odata/Events.md index 7235acf8..dcf31031 100644 --- a/docs/blazor_odata/Events.md +++ b/docs/blazor_odata/Events.md @@ -215,6 +215,15 @@ Notice that all handlers must be async. In this sample ```OrderValidator``` is a class that validates the ```Order``` object to be modified. If it's a valid item the event returns ```true```. If the item is not valid the event writes an error on the form and returns ```false```. +## Default CRUD data annotations validation + +GridBlazor validates by default all data annotations defined with attributes on the the model. This validation happens for Create and Update standard forms. If you use custom CRUD forms this will depend on your code. + +If you want to use custom validator classes on standard CRUD form, you can disable the default data annotation validation to avoid validators collisions. +It can be disabled using the ```SetDataAnnotationsValidation``` method of the ```GridClient``` object. +An then you have to configure your custom validators using the ```BeforeInsert```, ```BeforeUpdate``` and ```BeforeDelete``` events. + + ## Events for subgrids and nested CRUD subgrids If you want to define events for a subgrid and/or a nested CRUD subgrid you must handle in the ```OnAfterRender``` method of the subgrid component. diff --git a/docs/blazor_server/Events.md b/docs/blazor_server/Events.md index 4d4f959f..8b1f8037 100644 --- a/docs/blazor_server/Events.md +++ b/docs/blazor_server/Events.md @@ -212,6 +212,15 @@ Notice that all handlers must be async. In this sample ```OrderValidator``` is a class that validates the ```Order``` object to be modified. If it's a valid item the event returns ```true```. If the item is not valid the event writes an error on the form and returns ```false```. +## Default CRUD data annotations validation + +GridBlazor validates by default all data annotations defined with attributes on the the model. This validation happens for Create and Update standard forms. If you use custom CRUD forms this will depend on your code. + +If you want to use custom validator classes on standard CRUD form, you can disable the default data annotation validation to avoid validators collisions. +It can be disabled using the ```SetDataAnnotationsValidation``` method of the ```GridClient``` object. +An then you have to configure your custom validators using the ```BeforeInsert```, ```BeforeUpdate``` and ```BeforeDelete``` events. + + ## Events for subgrids and nested CRUD subgrids If you want to define events for a subgrid and/or a nested CRUD subgrid you must handle in the ```OnAfterRender``` method of the subgrid component. diff --git a/docs/dotnetcore_blazor/Events.md b/docs/dotnetcore_blazor/Events.md index a1ebdb3f..bc2085f3 100644 --- a/docs/dotnetcore_blazor/Events.md +++ b/docs/dotnetcore_blazor/Events.md @@ -212,6 +212,15 @@ Notice that all handlers must be async. In this sample ```OrderValidator``` is a class that validates the ```Order``` object to be modified. If it's a valid item the event returns ```true```. If the item is not valid the event writes an error on the form and returns ```false```. +## Default CRUD data annotations validation + +GridBlazor validates by default all data annotations defined with attributes on the the model. This validation happens for Create and Update standard forms. If you use custom CRUD forms this will depend on your code. + +If you want to use custom validator classes on standard CRUD form, you can disable the default data annotation validation to avoid validators collisions. +It can be disabled using the ```SetDataAnnotationsValidation``` method of the ```GridClient``` object. +An then you have to configure your custom validators using the ```BeforeInsert```, ```BeforeUpdate``` and ```BeforeDelete``` events. + + ## Events for subgrids and nested CRUD subgrids If you want to define events for a subgrid and/or a nested CRUD subgrid you must handle in the ```OnAfterRender``` method of the subgrid component.