Summary1.js 1.6 KB

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