List.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /**
  2. * 学科信息
  3. */
  4. Ext.define('school.view.basic.subject.List', {
  5. extend: 'school.view.core.base.BasePanel',
  6. xtype: 'basic-subject-list',
  7. // dataUrl: 'http://10.1.80.47:9560/subject/list',
  8. dataUrl: '/api/school/subject/list',
  9. _title: '学科信息',
  10. caller: 'Subject',
  11. pathKey: 'subject',
  12. controller: 'basic-subject-list',
  13. viewModel: 'basic-subject-list',
  14. initComponent: function() {
  15. var me = this;
  16. Ext.apply(this, {
  17. searchField: [{
  18. xtype: 'textfield',
  19. name: 'subject_name',
  20. fieldLabel: '名称'
  21. }],
  22. gridConfig: {
  23. addTitle: '学科信息',
  24. addXtype: 'basic-subject-detail',
  25. idField: 'subject_id',
  26. codeField: null,
  27. detailField: null,
  28. dataUrl: me.dataUrl,
  29. caller: null,
  30. rootProperty: 'data.list',
  31. totalProperty: 'data.total',
  32. actionColumn: [],
  33. selModel: {
  34. type: 'cellmodel'
  35. },
  36. hiddenTools: false,
  37. toolBtns: [{
  38. xtype: 'button',
  39. text: '新增',
  40. handler: 'onAddClick'
  41. }],
  42. columns : [{
  43. text: 'id',
  44. dataIndex: 'subject_id',
  45. hidden: true
  46. }, {
  47. text: '名称',
  48. dataIndex: 'subject_name',
  49. width: 150
  50. }, {
  51. xtype:'actioncolumn',
  52. width:70,
  53. dataIndex:'actioncolumn',
  54. text:'操作',
  55. align: 'center',
  56. items: [{
  57. tooltip: '编辑',
  58. iconCls: 'x-fa fa-pencil fa-fw',
  59. scope:this,
  60. listeners: {
  61. click: function() {
  62. debugger;
  63. }
  64. }
  65. },{
  66. text:'删除',
  67. iconCls:'x-fa fa-trash-o fa-fw',
  68. tooltip: '删除',
  69. scope:this
  70. }],
  71. listeners: {
  72. click: 'onActionClick'
  73. }
  74. }]
  75. },
  76. });
  77. this.callParent(arguments);
  78. },
  79. listeners: {
  80. load: function() {
  81. Ext.StoreMgr.get('store_subject').load();
  82. }
  83. }
  84. });