I have a GridPanel in EXTJS4 with JSONstore. Like this:
var storeGridSpe = Ext.create('Ext.data.JsonStore',{
proxy: {
type: 'ajax',
url: 'get-data-for-gridspe.php',
reader: {
type: 'json',
root: 'rows',
totalProperty: 'totalCount'
}
},
autoDestroy: true,
fields: [
{name: 'specie'},
{name: 'conta'}
]
});
var GridSpe = Ext.create('Ext.grid.GridPanel',{
store: storeGridSpe,
id: 'gridspe',
flex:1,
autoScroll: true,
columns: [
{id:'specie', header: "Specie", dataIndex: 'specie', flex:1},
{id:'conta', header: "Selezioni", dataIndex: 'conta', width:75}
]
});
How can I get a value of the first GridPanel record? For example column “specie”.
Thank you very much.
This should work:
storeGridSpe.first().get('specie')ExtJS4 has changed model querying a bit, so you may need to a tweak to get this to work exactly right.
Here’s Ext.data.Store, which pointed me to the
first()method, and here’s Ext.data.Model, which indicatedget()as the method to use.4.0.xis still pretty volatile, so nothing or everything may work. 😛