Summary2.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**
  2. * 位置固定合计栏
  3. * 原生合计栏添加参数fixed: true
  4. */
  5. Ext.define('uas.view.grid.summary.Summary2', {
  6. extend: 'uas.view.grid.basic.Panel',
  7. xtype: 'summary2',
  8. features: [{
  9. ftype: 'summary',
  10. fixed: true
  11. }],
  12. columns: [{
  13. text: 'Company',
  14. width: 600,
  15. dataIndex: 'name',
  16. summaryType: 'count',
  17. summaryRenderer: function(value, summaryData, dataIndex) {
  18. return Ext.String.format('共有{0}条数据', value);
  19. }
  20. }, {
  21. text: 'Price',
  22. width: 150,
  23. formatter: 'usMoney',
  24. dataIndex: 'price',
  25. summaryType: 'average',
  26. summaryRenderer: function(value, summaryData, dataIndex) {
  27. return Ext.String.format('平均价格:{0}', Ext.util.Format.usMoney(value));
  28. }
  29. }, {
  30. text: 'Change',
  31. width: 80,
  32. renderer: 'renderChange',
  33. dataIndex: 'priceChange'
  34. }, {
  35. text: '% Change',
  36. width: 100,
  37. renderer: 'renderPercent',
  38. dataIndex: 'priceChangePct'
  39. }, {
  40. text: 'Last Updated',
  41. width: 115,
  42. formatter: 'date("m/d/Y")',
  43. dataIndex: 'priceLastChange'
  44. }, {
  45. xtype: 'actioncolumn',
  46. width: 50,
  47. menuDisabled: true,
  48. sortable: false,
  49. items: [{
  50. iconCls: 'x-fa fa-check green',
  51. handler: 'onApprove'
  52. }, {
  53. iconCls: 'x-fa fa-ban red',
  54. handler: 'onDecline'
  55. }]
  56. }]
  57. });