Panel.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. Ext.define('uas.view.grid.basic.Panel', {
  2. extend: 'Ext.grid.Panel',
  3. xtype: 'basic-grid',
  4. controller: 'basicgrid',
  5. requires: [
  6. 'uas.view.grid.basic.PanelController',
  7. 'uas.data.Company',
  8. 'uas.model.Company',
  9. 'uas.store.Companies'
  10. ],
  11. stateful: true,
  12. multiSelect: true,
  13. stateId: 'stateGrid',
  14. headerBorders: false,
  15. viewModel: {
  16. stores: {
  17. companies: {
  18. type: 'companies',
  19. autoLoad: true,
  20. }
  21. }
  22. },
  23. viewConfig: {
  24. enableTextSelection: true
  25. },
  26. bind: '{companies}',
  27. columns: [{
  28. text: 'Company',
  29. flex: 1,
  30. dataIndex: 'name'
  31. }, {
  32. text: 'Price',
  33. width: 95,
  34. formatter: 'usMoney',
  35. dataIndex: 'price'
  36. }, {
  37. text: 'Change',
  38. width: 80,
  39. renderer: 'renderChange',
  40. dataIndex: 'priceChange'
  41. }, {
  42. text: '% Change',
  43. width: 100,
  44. renderer: 'renderPercent',
  45. dataIndex: 'priceChangePct'
  46. }, {
  47. text: 'Last Updated',
  48. width: 115,
  49. formatter: 'date("m/d/Y")',
  50. dataIndex: 'priceLastChange'
  51. }, {
  52. xtype: 'actioncolumn',
  53. width: 50,
  54. menuDisabled: true,
  55. sortable: false,
  56. items: [{
  57. iconCls: 'x-fa fa-check green',
  58. handler: 'onApprove'
  59. }, {
  60. iconCls: 'x-fa fa-ban red',
  61. handler: 'onDecline'
  62. }]
  63. }],
  64. signTpl: '<span style="' +
  65. 'color:{value:sign(\'"#cf4c35"\',\'"#73b51e"\')}"' +
  66. '>{text}</span>'
  67. });