If the user tries to insert a record into a grid that violates a MySQL back end unique key, I want to show a reasonable error message and delete the row from the grid. I defined:
dpg.defineAction(‘error’,function(xmlresponse){
var msg=xmlresponse.getAttribute(‘message’);
alert(msg);
return true;
}
Problems:
- Message is null and tells me nothing.
The xml returned from data processor using php grid connector is:
action type=“error” sid=“1552857346323” tid=“1552857346323”
which is not helpful as it doesn’t tell me the error was a duplicate.
How can I tell the cause of the insert failure for a decent error message? - The defective row is not deleted. Is there a return value or default action that deletes the failed insert from the grid? Do it manually with the sid or tid I guess?
- I may need to go to smart rendering or dynamic loading so I don’t want to verify before sending that record is unique if possible.