I have a grid which is set to editable:true, batch: false, and then I have and "add new" button via the toolbar: ["create"] directive. When a user clicks on that it instantly pings the backend server. The row requires a number of fields to be filled in before it is considered and valid. So right now until all the fields are valid, I return an error.
The problem is conveying that the user must enter all required fields before it is saved on the backend. How can I get within the error: function(e){...} the most recent row that it is trying to sync? I'd ideally want to continue to highlight whatever fields are missing as "required" until they fill them all in. I'd also want it to leave the icon in the top left of the box on the ones showing they are not yet saved.
I could return then something like:
{
"errors": {
"name": [
"REquired"
],
"description": [
"required",
"must be more than 5 characters"
]
}
}
Then I'd loop through the errors and match up the fields that have errors and show some sort of indication to the end user.
Let me know what was is best to accomplish that or if there is a better way I should be doing this.
Thanks,
Matt