Panel.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. Ext.define('uas.view.grid.rowManager.Panel', {
  2. extend: 'Ext.grid.Panel',
  3. xtype: 'row-manager',
  4. controller: 'row-manager',
  5. requires: [
  6. 'Ext.grid.plugin.CellEditing',
  7. 'Ext.ux.grid.plugin.MenuClipboard'
  8. ],
  9. plugins: [{
  10. ptype: 'menuclipboard'
  11. }, {
  12. ptype: 'cellediting',
  13. clicksToEdit: 1,
  14. }],
  15. columns: [{
  16. xtype: 'rownumberer'
  17. }, {
  18. text: '姓名',
  19. dataIndex: 'name',
  20. editor: {
  21. xtype: 'textfield'
  22. }
  23. }, {
  24. text: '邮箱',
  25. dataIndex: 'email',
  26. width: 260,
  27. editor: {
  28. xtype: 'textfield'
  29. }
  30. }, {
  31. text: '电话',
  32. dataIndex: 'phone',
  33. width: 180,
  34. editor: {
  35. xtype: 'numberfield'
  36. }
  37. }],
  38. store: {
  39. type: 'row-manager',
  40. data: [{ name: 'lucy', email: 'lucy@shee.com', phone: '83141231' }]
  41. },
  42. tbar: [{
  43. text: '添加行',
  44. handler: 'onRowAdd'
  45. }, {
  46. text: '插入行',
  47. handler: 'onRowInsert'
  48. }, {
  49. text: '删除行',
  50. handler: 'onRowRemove'
  51. }]
  52. });