1

示例表:

|-Field quantity-|-Field quantity loss-|----Total------|
|-----2----------|-------4-------------|---total=2+4---|
|-----3----------|-------5-------------|---total=3+5---|

我可以通过 extjs 上的函数渲染它吗?

总计=田地数量+田地数量损失

4

1 回答 1

3

是的,您必须使用网格 getColumnModel 方法。

  grid.getColumnModel().setRenderer(2, function(value, metaData, record, rowIndex, colIndex, store) {
      return record.get('quantity') + record.get('loss');
    });

更多信息:http ://dev.sencha.com/deploy/ext-3.3.1/docs/?class=Ext.grid.GridPanel和
http://dev.sencha.com/deploy/ext-3.3.1/ docs/?class=Ext.grid.ColumnModel?class=Ext.grid.ColumnModel

于 2011-06-07T05:44:03.777 回答