我设计了一个ExtJS GridPanel,并从数据库填充了数据。我的需求是当单击一个网格行(如编辑按钮)时,从网格中获取一个id,并用特定的数据填充一个窗口(使用数据库中的id检索数据)。我如何才能做到这一点?
发布于 2011-04-26 19:00:06
使用以下命令:
grid.on('rowclick', function(grid, rowIndex, columnIndex, e) {
console.log(grid, rowIndex, columnIndex, e);
}, this);编辑:有关网格相关问题,请参阅ExtJS Grid FAQ部分
发布于 2015-01-28 20:06:34
将其添加到网格的侦听器中:
listeners: {
cellclick: function (grd, rowIndex, colIndex, e) {
var record = grd.getStore().getAt(rowIndex);
var record = grd.getStore().getAt(rowIndex);
}
}发布于 2011-04-26 18:59:29
看看来自Ext JS 3.3 Examples的this example,它的特性与您所描述的机制类似。主要源代码可以在here上看到。
其他与网格相关的官方示例(数据绑定等)可能也值得一看。
https://stackoverflow.com/questions/5789037
复制相似问题