ruialexrib
1 Nov 2012, 1:11 PM
i making my first steps with ExtJs and cant figure out whats the problem with this example...
the grid is showing but with no records
Ext.onReady(function () {
var store = new Ext.data.JsonStore({
root: 'results',
autoLoad: true,
fields: ['name'],
data: {
results: [
{ "name": "John Smith" },
{ "name": "Anna Smith" }
]
}
});
var grid = new Ext.grid.GridPanel({
width: 600,
height: 200,
store: store,
columns: [
{
id: 'name',
header: "NAME",
sortable: true,
dataIndex: 'name'
}
],
});
// render grid
grid.render('db-grid');
});
the grid is showing but with no records
Ext.onReady(function () {
var store = new Ext.data.JsonStore({
root: 'results',
autoLoad: true,
fields: ['name'],
data: {
results: [
{ "name": "John Smith" },
{ "name": "Anna Smith" }
]
}
});
var grid = new Ext.grid.GridPanel({
width: 600,
height: 200,
store: store,
columns: [
{
id: 'name',
header: "NAME",
sortable: true,
dataIndex: 'name'
}
],
});
// render grid
grid.render('db-grid');
});