summary3.js 1.7 KB

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