How do you validate a column in a RowEditDialog. I am using the following:
{ columnKey: "uc", editorType: "text", required: true, validatorOptions: { onblur: function (evt, ui) { alert("why...always...why"); } } }
Under Updating -> ColumnSettings.
Nothing seems to work.
Hello William,
Please note that onBlur is a Boolean option and you can set it either true or false. Also within the grid widget, validatorOptions is accessible through editorOptions object. You can set custom error message using for example something similar to the following code:
columnSettings: [ { columnKey: "first_name", editorType: "text", editorOptions: { validatorOptions: { required: { errorMessage: "Custom required" } } } }]
Thanks for your reply. What I was want to do is call as custom validation method onblur and show a custom messaage if it fails while keeping focus. How do I do that? Also I assume onblur (true) means validate onblur, is that correct? Is there a list of these options?
Tsanna you can disregard, I think I was able to figure this out.
editorOptions: { validatorOptions: { required: { errorMessage: "You must enter a unit code to continue." }, onblur: true, custom: function (ui, evt) { .....your code here }, errorMessage: "your error message"
} }
Thanks again.
Ok. If I can be of further assistance for you, please let me know.