in order to saved bandwidth and lines of code, I have a web services of the kind:
GET /users
[return json data]
{
"headers": ["Joined", "username", "Age"],
"data": [["2011-01-01", "alice", 22],["2011-01-01", "bob", 22]]
}
How to display this object in a grid/table using extJS?
username Joined Age
alice 2011-01-01 22
bob 2011-01-01 22
Note: I wish not to use a data store/model object in extJS (and have to define fields etc), just display the matrix as-given by the server
thanks//David
If you want to display your data using
Ext.grid.Panelthen you have to use a store. Period. You don’t necessarily have to create a model if you define the fields directly on the store declaration, but you still need the store.If you want to display your data using a generic HTML table, you can use
Ext.XTemplateto do so. It would look something like this (example code):You can modify the look and styles by using the template, but this will let you use a regular JavaScript object to generate your table.