From e12826bb59e5fa388adc370d6a0c96f5437e02de Mon Sep 17 00:00:00 2001 From: Bogdan Gusiev Date: Thu, 14 Nov 2024 10:26:28 +0100 Subject: [PATCH] Mention the removal of grid class from table[class] --- version-2/Readme.markdown | 68 +++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 27 deletions(-) diff --git a/version-2/Readme.markdown b/version-2/Readme.markdown index 68772e1..506dd92 100644 --- a/version-2/Readme.markdown +++ b/version-2/Readme.markdown @@ -294,8 +294,18 @@ will always generate from/to inputs instead: It is more semantic and collision proof to use `data-*` attributes instead of classes for meta information from backend. Therefor built-in partials now generate data attributes by default -instead of classes for column names: +instead of classes for column names. +* Filter name `input[class]` implemented as `.datagrid-filter[data-filter]`. +* Filter type `input[class]` implemented as `.datagrid-filter[data-type]`. +* Grid class `table[class]` removed due to: + * security concerns from some users + * breaking CSS classes naming convention +* Column name `th[class], td[class]` implemented as `td[data-column], th[data-column]`. + +Note that the behavior change can be reverted by +[updating built-in partials](https://github.com/bogdan/datagrid/wiki/Frontend#modifying-built-in-partials). +Version 2 makes it as easy as possible to override the defaults of the UI. ### Filters @@ -319,42 +329,46 @@ Version 2: ``` -Diff for [built-in partials between V1 and V2](./views.diff) +Diff for [built-in views between V1 and V2](./views.diff) ### Columns Version 1: ``` html - - Name - Category - - - John - Worker - - - Mike - Manager - + + + + + + + + + +
NameCategory
John + Worker +
Mike + Manager +
``` Version 2: ``` html - - Name - Category - - - John - Worker - - - Mike - Manager - + + + + + + + + + +
NameCategory
John + Worker +
Mike + Manager +
``` If you still want to have an HTML class attached to a column use `class` column option: @@ -371,7 +385,7 @@ Renders: John ``` -[Modify built-in partials](https://github.com/bogdan/datagrid/wiki/Frontend#modifying-built-in-partials) +[Modify built-in views](https://github.com/bogdan/datagrid/wiki/Frontend#modifying-built-in-partials) if you want to change this behavior completely. ## id attribute for range filter inputs