max*_*mus 2 javascript extjs javascript-framework 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);
}
}
Run Code Online (Sandbox Code Playgroud)
...等等...
我无法弄清楚如何获取行中第一列的单元格值.我也尝试过:
var record = grid.getStore().getAt(iRowIdx); // Get the Record
alert(iView.getRecord().get('id'));
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
提前致谢!
它比你拥有的更容易.
请查看此处的公司列配置示例 - http://jsfiddle.net/qr2BJ/4580/
编辑:
网格定义代码的一部分:
....
columns: [
{
text : 'Company',
flex : 1,
sortable : false,
dataIndex: 'company',
renderer : function (value, metaData, record, row, col, store, gridView) {
metaData.tdAttr = 'data-qtip="' + record.get('price') + ' is the price of ' + value + '"';
return value;
}
},
....
Run Code Online (Sandbox Code Playgroud)