Panel.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. Ext.define('uas.view.grid.copyPaste.Panel', {
  2. extend: 'uas.view.grid.basic.Panel',
  3. xtype: 'grid-copy-paste',
  4. requires: [
  5. 'Ext.grid.plugin.CellEditing',
  6. 'Ext.grid.selection.SpreadsheetModel',
  7. 'Ext.ux.grid.plugin.MenuClipboard'
  8. ],
  9. plugins: [{
  10. ptype: 'menuclipboard'
  11. }, {
  12. ptype: 'cellediting',
  13. clicksToEdit: 2,
  14. }],
  15. selModel: {
  16. type: 'spreadsheet'
  17. },
  18. columns: [{
  19. text: 'Company',
  20. flex: 1,
  21. dataIndex: 'name',
  22. editor: {
  23. xtype: 'textfield'
  24. }
  25. }, {
  26. text: 'Price',
  27. width: 95,
  28. formatter: 'usMoney',
  29. dataIndex: 'price',
  30. editor: {
  31. xtype: 'numberfield'
  32. }
  33. }, {
  34. text: 'Change',
  35. width: 80,
  36. renderer: 'renderChange',
  37. dataIndex: 'priceChange',
  38. editor: {
  39. xtype: 'numberfield'
  40. }
  41. }, {
  42. text: '% Change',
  43. width: 100,
  44. renderer: 'renderPercent',
  45. dataIndex: 'priceChangePct',
  46. editor: {
  47. xtype: 'numberfield'
  48. }
  49. }, {
  50. text: 'Last Updated',
  51. width: 115,
  52. formatter: 'date("m/d/Y")',
  53. dataIndex: 'priceLastChange',
  54. editor: {
  55. xtype: 'datefield'
  56. }
  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. });