Disable a cell edit depending on the value of the other column

Disable a cell edit depending on the value of the other column

rasikah12rasikah12 Posts: 4Questions: 2Answers: 0

I have refered this link to build my datatable. I wanted to edit only certain columns, so for that I used "<td data-title="{{row.name}}" class="name" data-name="name" data-type="text" data-pk="{{row.id}}">{{row.name}}</td>" this method to make the column editable. But now I want to make the "position" editable only if the value of the other column is "Available". If it is "Unavailable" it should be read only. And if anybody clicks on that cell it should give an alert saying "Editing not allowed since it is Unavailable."
I referred to a couple of questions on forum but couldn't build properly.
In the link I am using static data but I have used for loop to populate the data dynamically. I am new to js so tried to edit as much as I could.
I would really appreciate some help!
Thanks!

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    You can do that easily with Editor - see this example from this thread - you can only edit a row if the Office is "London".

    Colin

  • rasikah12rasikah12 Posts: 4Questions: 2Answers: 0

    Thanks Colin! It worked.

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Our accounts aren't showing that you have an Editor license. Is the license registered to another email address? Please can let us know so we can update our records.

    Thanks,

    Colin

Sign In or Register to comment.