From 83ece81e7f9b4dab39a7832f8882d410ff0c3df7 Mon Sep 17 00:00:00 2001 From: sbejaoui Date: Mon, 4 Oct 2021 18:24:32 +0200 Subject: [PATCH] [FIX] - add support for extra attributes using field_att_ --- web_widget_x2many_2d_matrix/README.rst | 4 ++++ web_widget_x2many_2d_matrix/readme/USAGE.rst | 4 ++++ .../static/description/index.html | 7 +++++-- .../static/src/js/2d_matrix_renderer.js | 18 ++++++++++++++---- .../js/abstract_view_matrix_limit_extend.js | 12 ++++++++++++ .../static/src/js/widget_x2many_2d_matrix.js | 5 ++++- 6 files changed, 43 insertions(+), 7 deletions(-) diff --git a/web_widget_x2many_2d_matrix/README.rst b/web_widget_x2many_2d_matrix/README.rst index 9ebe430b1..2e84fd925 100644 --- a/web_widget_x2many_2d_matrix/README.rst +++ b/web_widget_x2many_2d_matrix/README.rst @@ -94,6 +94,8 @@ show_row_totals show_column_totals If field_value is a numeric field, it indicates if you want to calculate column totals. True by default +field_att_ + Declare `disabled` or `hidden` options prefixed with this string as you need for binding a field value with an HTML node attribute called as the passed in the option. Example ~~~~~~~ @@ -150,6 +152,8 @@ Now in our wizard, we can use: +Note that all values in the matrix must exist, so you need to create them previously if not present, but you can control visually the editability of the fields in the matrix through field_att_disabled option with a control field. + Known issues / Roadmap ====================== diff --git a/web_widget_x2many_2d_matrix/readme/USAGE.rst b/web_widget_x2many_2d_matrix/readme/USAGE.rst index 514257d00..3aa89437c 100644 --- a/web_widget_x2many_2d_matrix/readme/USAGE.rst +++ b/web_widget_x2many_2d_matrix/readme/USAGE.rst @@ -35,6 +35,8 @@ show_row_totals show_column_totals If field_value is a numeric field, it indicates if you want to calculate column totals. True by default +field_att_ + Declare `disabled` or `hidden` options prefixed with this string as you need for binding a field value with an HTML node attribute called as the passed in the option. Example ~~~~~~~ @@ -90,3 +92,5 @@ Now in our wizard, we can use: + +Note that all values in the matrix must exist, so you need to create them previously if not present, but you can control visually the editability of the fields in the matrix through field_att_disabled option with a control field. diff --git a/web_widget_x2many_2d_matrix/static/description/index.html b/web_widget_x2many_2d_matrix/static/description/index.html index 071821eca..4e8df3372 100644 --- a/web_widget_x2many_2d_matrix/static/description/index.html +++ b/web_widget_x2many_2d_matrix/static/description/index.html @@ -3,7 +3,7 @@ - + 2D matrix for x2many fields