I have used jQuery datatable CellEdit ( https://github.com/ejbeaty/CellEdit ) for table inline editor. This is a free lib. It's working awesome. This lib already provides required field validation.
For required validations, need to mention the column index inside of the columns array. Please see this code.
"allowNulls": {
"columns": [],
"errorClass": 'error'
}
For example, The table has 5 columns. if we need required field validation for the first 3 columns means, then need to use columns:[0,1,2]
.
The above mentioned code was inside of the table.MakeCellsEditable function. For more info please read the documentation ( https://github.com/ejbeaty/CellEdit/blob/master/README.md ).
This validation working well if we click confirm button without fill any values in the text box.
But, if I just leave it blank space means, the validations don't work. So, I can able to save the value in my DB with blank values.
So, I need to validate with blank space also.