When cell editing is attempted in an igGrid, and all the others cells on the same row are read-only, the Done button is disabled even if the current cell has been modified. After a row with more editable cells is edited, then when editing the row with only one editable cell the Done button correct behavior is restored.
All read-only cells are disabled using “editCellStarting” method.
Please check this out here: http://jsfiddle.net/D3uPN/4/
Edit first row and change cell value, “Done” button still disabled.
Cancel and edit second row, press done.
Edit first row, now the “Done” buttons works correct.
Am i doing something wrong, or is this a bug?
Hello Corne van Beek,
I am unable to reproduce the issue you are describing. I am able to click the done button after my first edit of the first row. Could it be that you are not editing the row at all and therefore not seeing the done button highlight? The inability to click done when you haven't edited the row at all is expected behavior. Please view my attached screencast showing the behavior I am receiving and expecting. Please let me know if this is consistent with your behavior.
Hi Joe,
Thanks for the help so far.
The same issue will occur in your new example, with the 'done' button not enabling the first time. But I think I found the problem:
If there is a row with some readonly columns, but some of those columns have a required setting enabled. The done button will never be enabled because that readonly column is required (and the editor doesn't exists yet).
So for example in our JSFiddle, if we change the 'BirthDate' column to 'required: false', the Done button just works fine.
A workaround seems to be to update the required setting, before the edit starts with:
$("#grid").igGridUpdating("option", "columnSettings")[x].required = false;
Do you have any other/better suggestions, we could make this works, because the solution above doesn't feel to be the cleanest
Is there anything else I can assist you with on the matter? Please do not hesitate to contact me with more questions.
I've looked into the fiddle some more, since your example does work. The problem is the datepicker with the required: true option. When you remove that option, everything works as expected. With that option enabled it doesn't work. Maybe because it thinks the row is not valid because of the required datepicker? Since that cell is disabled, that should not be the case.
So after editing a row with the datepicker cell enabled it all works because the datepicker now has (had) a valid value.
I apologize for the misunderstanding. Please view the attached sample with the correct functionality. You will see that I used the editCellStarting event which is called when a row begins editing for each column. In this function, you can check the value in the cell and return false if it contains a value you do not want to edit. Returning false will disable editing in that cell, as desired. Please let me know if you have any questions, or if I can be of further assistance.