Panel.js 1.4 KB

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