PDA

View Full Version : Grid from Form [MVC]



zoga08
10 Jun 2013, 6:17 AM
Hi guys,

Im trying to make a app to populate a grid after I choose a few parameters from a Form, like this.

44263
Then I will click in "Gerar Indicadores" and after I press the button, it has to show me the grid. I dont know how to send the values from startDate, endDate and cbValues from form to my PHP app for database manipulation.

Any Ideas?

zoga08
10 Jun 2013, 12:20 PM
Any Ideas?

:D:D:D

existdissolve
10 Jun 2013, 2:12 PM
Well, go step by step.

First, start with your form, and get the values from the form: http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.form.Panel-method-getValues

N (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.form.Panel-method-getValues)ext, if you haven't already created an instance of your grid, do that:
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.grid.Panel

T (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.grid.Panel)hen, load the store of your grid, and pass the values from the form as params:
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.data.Store-method-load


(http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.data.Store-method-load)

existdissolve
10 Jun 2013, 2:13 PM
Also, if you want to remove the roundedness and extra border of your form, just remove the "frame" config from the form panel :)

zoga08
11 Jun 2013, 10:20 AM
Thanks.

I will try that existdissolve =)

zoga08
11 Jun 2013, 11:04 AM
Man, I'm stucked ..

I can get the form values with the:


var values = form.getValues();

but i dont know how to send the value to the PHP file, I tried the store.load, but it didnt work. Im trying to send information from the form to the PHP file because I have multiple selects depending on my checkbox value.

:(

slemmon
11 Jun 2013, 9:06 PM
For an example on submitting form data to your server script have you seen the example at the top of the API docs for form panel?
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.form.Panel