Panel.js 1.5 KB

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