Summary2.js 1.7 KB

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