[IMP] web: Expose datepicker configuration to view declarations
The lower-level widget itself supports passing options to the underlying
datepicker library. However this is not exposed to higher-level view
declaration. With this patch, one can declare a field in a view such as:
```xml
<field name="datefield" options='{"daysOfWeekDisabled": [0, 6]}'/>
```
That option would land in the widget and disable those weekdays.
Documentation has been updated accordingly.
Closes #25044.
This commit is contained in:
committed by
Thibault Delavallée
parent
4d3debe2c3
commit
71334b13bd
@@ -1329,11 +1329,27 @@ order.
|
||||
|
||||
- Supported field types: *date*, *datetime*
|
||||
|
||||
Options:
|
||||
|
||||
- datepicker: extra settings for the datepicker_ widget.
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<field name="datefield" options='{"datepicker": {"daysOfWeekDisabled": [0, 6]}}'/>
|
||||
|
||||
- datetime (FieldDateTime)
|
||||
This is the default field type for fields of type *datetime*.
|
||||
|
||||
- Supported field types: *date*, *datetime*
|
||||
|
||||
Options:
|
||||
|
||||
- datepicker: extra settings for the datepicker_ widget.
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<field name="datefield" options='{"datepicker": {"daysOfWeekDisabled": [0, 6]}}'/>
|
||||
|
||||
- monetary (FieldMonetary)
|
||||
This is the default field type for fields of type 'monetary'. It is used to
|
||||
display a currency. If there is a currency fields given in option, it will
|
||||
@@ -1814,4 +1830,6 @@ Relational fields
|
||||
.. _event delegation:
|
||||
http://api.jquery.com/delegate/
|
||||
|
||||
.. _datepicker: https://github.com/Eonasdan/bootstrap-datetimepicker
|
||||
|
||||
.. _deferred: http://api.jquery.com/category/deferred-object/
|
||||
|
||||
Reference in New Issue
Block a user