Open Gaetanbrl opened 8 months ago
Currently, if we add editable prop by field for FeatureEditor plugin, this not works fine because editor mode can be activate from each other editable column.
By default, react-data-grid seems correctly check that field is editable or not and need a dble click to open cell editor view. Here a native example where only 2/3 cols are editable :
https://codepen.io/gaetanbrl/pen/OJqyZzQ
Here mapstore example where NOM
column have editable: false
prop but user can always edit if editor is activated from other column :
Maybe MapStore2 gridEvents
(or other code) is not compliant with this dev and needs to be change (i will analyse that now).
@offtherailz do you know why cell editor still open when we click on other cell ? is this what you want ?
I found 2 others alternatives.
disabled
props on each Editortested and works fine
This solution needs to change Editor code to insert disabled
property if the column is not editable.
Here, the nom
field is disabled and cursor show red circle on hover (ease to understand by all users) :
tested and works fine
The solution needs to change Editor code to render null
if the column is not editable.
Here, the nom
field is not editable :
Here an Editor (<input>
) code example for this solution :
Description
According to the new Fields UI, it could be usefull to manage edition by fields.
This could be an answer to this use case :
Many way exists to do that.
I propose first to manage this by customEditorOptions in order to use regeEx control on field name. Then, editors can catch the props and affect editable value (true/false).
Next, I imagine in a second time to manage this type of configuration by the new
fields
UI. This requires to create a new columns in Fields table but it could be less good than expected. So, another way to do that infields
is to create a "settings" button by fields to open a modal and display many options asallowEdit
and future improvements (i will create new ones).I know that geoserver will always allow edition if someone use Qgis with the correct credentials, but we have many cases where basic user profile just use mapstore and needs to be regulated.
What kind of improvement you want to add? (check one with "x", remove the others)
Other useful information
Please, share your point of view and technical advices according to mapstore2 good practices and possibility.