summary3.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /**
  2. * 服务端计算合计栏
  3. */
  4. Ext.define('uas.view.grid.summary.Summary3', {
  5. extend: 'uas.view.grid.basic.Panel',
  6. xtype: 'summary3',
  7. requires: [
  8. 'Ext.grid.feature.Summary'
  9. ],
  10. features: [{
  11. ftype: 'summary',
  12. fixed: true,
  13. remoteRoot: 'data.summary'
  14. }],
  15. bbar: {
  16. xtype: 'pagingtoolbar',
  17. displayInfo: true
  18. },
  19. store: {
  20. type: 'companies',
  21. autoLoad: true,
  22. pageSize: 10,
  23. },
  24. columns: [{
  25. text: 'Company',
  26. width: 600,
  27. dataIndex: 'name',
  28. summaryType: 'count',
  29. summaryRenderer: function(value, summaryData, dataIndex) {
  30. return Ext.String.format('共有{0}条数据', value);
  31. }
  32. }, {
  33. text: 'Price',
  34. width: 150,
  35. formatter: 'usMoney',
  36. dataIndex: 'price',
  37. summaryType: 'average',
  38. summaryRenderer: function(value, summaryData, dataIndex) {
  39. return Ext.String.format('平均价格:{0}', Ext.util.Format.usMoney(value));
  40. }
  41. }, {
  42. text: 'Change',
  43. width: 80,
  44. renderer: 'renderChange',
  45. dataIndex: 'priceChange'
  46. }, {
  47. text: '% Change',
  48. width: 100,
  49. renderer: 'renderPercent',
  50. dataIndex: 'priceChangePct'
  51. }, {
  52. text: 'Last Updated',
  53. width: 115,
  54. formatter: 'date("m/d/Y")',
  55. dataIndex: 'priceLastChange'
  56. }, {
  57. xtype: 'actioncolumn',
  58. width: 50,
  59. menuDisabled: true,
  60. sortable: false,
  61. items: [{
  62. iconCls: 'x-fa fa-check green',
  63. handler: 'onApprove'
  64. }, {
  65. iconCls: 'x-fa fa-ban red',
  66. handler: 'onDecline'
  67. }]
  68. }]
  69. });