Validation - Empty or Integer

I have a question about validation. I have a column in the grid which can be “empty” or if it has value the value must be “integer”. That means if user clicks in a cell in this column, user can enter either an integer or can click on the cell but leave the cell empty. I tried using ValidInteger, but what happens is, once the user clicks in the cell, he cannot leave the cell empty. It expects an integer value in that cell.
How can I do this validation. Please help.


You can define your own validation rules, which can have any custom logic.

dhtmlxValidation.isValidIntegerOrEmpty = function(value){ return !!( !value || value.toString().match(/(^-?\d+$)/) ); };

Now you can use isValidIntegerOrEmpty rule for validation