Rovak / KJSencha

Ext-JS / Sencha Touch Integration Module for Zend Framework 2
Other
24 stars 15 forks source link

What's the correct way to work with forms? #24

Closed 4orever closed 11 years ago

4orever commented 11 years ago

There are to ways to work with forms using KJSencha:

  1. Set 'api.submit' config option and then do form.submit() and @Formhandler annotation. So the main question: What is the correct way to get form POST data?
  2. Use getForm().getRecord() and then call create/update direct method.

Is there any advantages of first variant?

Rovak commented 11 years ago

The correct way is to use the form submit method with the @Formhandler annotation and then retrieve the POST values from the first function parameter.

An example can be found here: PHP, JS

The example works but is a bit misleading, the handler may not be necessary for your situation. You can still specify the methods by configuring the api methods as shown here, and use the values as demonstrated in the previous example.

4orever commented 11 years ago

Rovak, thank you for your answer! It's logical, I should guess.