我有一個網格下面的代碼:獲取網格單元格數值懸停在ExtJS4
var grid = Ext.create('Ext.grid.Panel', {
store: store,
stateful: true,
stateId: 'stateGrid',
columns: [
{
text : 'Job ID',
width : 75,
sortable : true,
dataIndex: 'id'
},
{
text : 'File Name',
width : 75,
sortable : true,
dataIndex: 'filename',
listeners : {
'mouseover' : function(iView, iCellEl,
iColIdx, iRecord, iRowEl, iRowIdx, iEvent) {
var zRec = iView.getRecord(iRowEl);
alert(zRec.data.id);
}
}
...等...
我無法弄清楚如何獲取單元格的值該行中的第一列。我也試過:
var record = grid.getStore().getAt(iRowIdx); // Get the Record
alert(iView.getRecord().get('id'));
任何想法?
在此先感謝!
我覺得你非常親密。嘗試'alert(record.get('id'));'而不是'iView.getRecord ...' – Hemlock