PDA

View Full Version : Remote (Server) data validation together with DataWriter



DrZook
20 Sep 2010, 10:47 PM
Hello everybody
I've got a form with an attached grid, like in the famous CRUD sample here --> http://dev.sencha.com/deploy/dev/examples/writer/writer.html (http://dev.sencha.com/deploy/dev/examples/form/xml-form.html). The Store attached to this Form and grid has a DataWriter attached. Up to now, everything works fine. But now, I want to add validation for my data. It's important for this Project that the data gets validated on server side. My question now is: can the datawriter oder whatsoever component in the Store handle and show validation errors sent back by the server? The result should look like this example (but this one uses the traditional form submit method)--> http://dev.sencha.com/deploy/dev/examples/form/xml-form.html. The Message my server sends back looks like this:


{
"success":false,
"message":"validation",
"data":[[{"firstname":""},{'blah':'blubb'},...]],
errors:[{"id":"firstname","msg":"First name must not be empty!"},]
}
If it's not possible automatically somehow, I guess I have to implement it by hand in the dataproxy exception event.

lg Dr. Zook