I have isDuplicate() function that I need to set as the validator function for my ValidationTextBox. So That's what I am doing:
parent=this;
var structure = [
{"id": "Name", "field": "Name", "name": "Name", width: "40%",
widgetsInCell: true,
alwaysEditing: true,
editor: ValidationTextBox,
editorArgs: {
props: 'required:true, validator: parent.isDuplicate ,invalidMessage:"Duplicate Name"'
}
I am receiving this error: Can not set cell value: TypeError: undefined is not a function
You have a scope issue. When props is processed by the ValidationTextBox the parent variable is no longer visible. Since I myself have been unable to determine a decent means of handling the scope within the props string, I've found the easiest solution is to wrap the widget to curry the context to the widget constructor:
OR using an IIFE:
I know this probably doesn't help you, being almost a full year later, but I figured it'd be worth posting since I ran into the exact same issue.