PDA

View Full Version : GridPanel with Data



hermann.s
11 Sep 2013, 3:50 AM
Greetings,

I'm a little confused as to how to create a GridPanel with data.

There are many ExtJS components that are involved.
Model, Store, Proxy, Reader, Columns.

All are components required?

Can you give a couple examples?

Do I HAVE to use a model?
Where are DB fields declared?

evant
11 Sep 2013, 3:53 AM
There's a whole bunch of examples in the SDK download to look at:

Model - Think of it like a table schema. What columns (fields) and what types.
Store - Like a data table, holds a bunch of rows (records)
Proxy - In charge of getting the data from a particular source. Eg memory, ajax, jsonp, localstorage. The proxy doesn't care what format the data is in, it's only in charge of retrieving it.
Reader - Reads data in a particular format, JSON, XML, CSV. The reader doesn't care where the data comes from, only the format.

Columns - The visual representation on the grid.

hermann.s
11 Sep 2013, 4:12 AM
Would it be possible to declare a store directly and not through a model?

evant
11 Sep 2013, 4:32 AM
You can declare fields on a store directly, but it will just create an anonymous model under the hood.