Changing a field type on an individual row, based on the value/name of another cell?
Changing a field type on an individual row, based on the value/name of another cell?
bsuk
Posts: 92Questions: 26Answers: 2
Take this simple two column table, containing some settings, for example.
I have inline editing enabled on the "value" column. However, for one of the rows (password), I'd like to change this input type to "password" rather than "text", to avoid the password being visible when the table is displayed.
Is this possible? Or can this only be done on a "per row" level?
Many thanks for any pointers.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi,
Currently no - it isn't possible to dynamically change a field type I'm afraid. What you can do is delete the existing field (
clear()
) and then add a new one of the required type (add()
). You would probably be best doing that before calling theedit()
action to trigger the editing. If you are using Buttons for that you will need to use a custom button.Regards,
Allan
Is this still not possible even through dependent() ?
Correct. The field type cannot be dynamically changed - it would need the field to be removed and then re-added as the new type.
Allan