Editor: How would one disable specific fields for editing in the inline tab edit example?

Editor: How would one disable specific fields for editing in the inline tab edit example?

naegelinnaegelin Posts: 1Questions: 1Answers: 0

I've successfully created my own version of this inline tab edited table:
https://editor.datatables.net/examples/inline-editing/tabControl.html

Literally I just used the same client side code locally and built my own PHP code to interact with the table. What is completely unclear to me is how one would go about disabling fields so that "tabbing" through the table would result in skipping the disabled fields.

As an example, if I didn't want the user to edit the "Office" column it would seem that I would simply add:

```editor.disable ('office');``` 

but this doesn't seem to work. Any guidance would be much appreciated as we really want to purchase the editor plugin but this is a 'key' feature for us.

Answers

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin

    What you need to do is update the tabbing code from the example you link to, so that it skips over the columns you don't want to be inline editable.

    The code already does that a little bit in that it skips over the first column (children().eq(1)) for example, so you expand upon that.

    A good way to start might be to add an editable class to the columns you want to be editable and then modify the code so it only selects editable classed columns.

    Allan

This discussion has been closed.