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?

bsukbsuk 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

Answers

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin
    Answer ✓

    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 the edit() action to trigger the editing. If you are using Buttons for that you will need to use a custom button.

    Regards,
    Allan

  • maliwikmaliwik Posts: 55Questions: 5Answers: 1

    Is this still not possible even through dependent() ?

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    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

This discussion has been closed.