GridPanel3.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. Ext.define('erp.view.data.GridPanel3',{
  2. extend: 'Ext.grid.Panel',
  3. alias: 'widget.erpGridPanel3',
  4. // id: 'grid',
  5. emptyText : '无数据',
  6. columnLines : true,
  7. autoScroll : true,
  8. FormUtil: Ext.create('erp.util.FormUtil'),
  9. GridUtil: Ext.create('erp.util.GridUtil'),
  10. plugins: [Ext.create('Ext.ux.grid.GridHeaderFilters')],
  11. BaseUtil: Ext.create('erp.util.BaseUtil'),
  12. store: Ext.create('Ext.data.Store', {
  13. fields: [{
  14. name:'ddd_tablename',
  15. type:'string'
  16. },{
  17. name:'ddd_fieldname',
  18. type:'string'
  19. },{
  20. name:'ddd_fieldtype',
  21. type:'string'
  22. }]
  23. }),
  24. iconCls: 'icon-grid',
  25. frame: true,
  26. bodyStyle:'background-color:#f1f1f1;',
  27. features: [Ext.create('Ext.grid.feature.Grouping',{
  28. groupHeaderTpl: '{name} ({rows.length} 封)'
  29. })],
  30. selModel: Ext.create('Ext.selection.CheckboxModel',{
  31. }),
  32. // dockedItems: [{
  33. // id : 'paging',
  34. // xtype: 'erpMailPaging',
  35. // dock: 'bottom',
  36. // displayInfo: true
  37. // }],
  38. columns: [{
  39. text: '表名',
  40. width: 160,
  41. dataIndex: 'ddd_tablename'
  42. },{
  43. text: '字段名',
  44. width: 160,
  45. dataIndex: 'ddd_fieldname'
  46. },{
  47. text: '字段类型',
  48. width: 160,
  49. dataIndex: 'ddd_fieldtype'
  50. }],
  51. tbar: [{
  52. iconCls: 'x-button-icon-add',
  53. text: '批量添加表字段',
  54. handler: function(btn){
  55. // var selectItem = Ext.getCmp('grid').selModel.selected.items;
  56. // if (selectItem.length == 0) {
  57. // showError("请先选中要删除的流程");return;
  58. // } else {
  59. // var ids = new Array();
  60. // Ext.each(selectItem, function(item, index){
  61. // ids[index] = item.data.jp_id;
  62. //// alert(ids[index]);
  63. // });
  64. // Ext.Ajax.request({//拿到grid的columns
  65. // url : basePath + 'oa/myprocess/delete.action',
  66. // params: {
  67. // ids : ids.join(',')
  68. // },
  69. // method : 'post',
  70. // async: false,
  71. // callback : function(options, success, response){
  72. // parent.Ext.getCmp("content-panel").getActiveTab().setLoading(false);
  73. // var res = new Ext.decode(response.responseText);
  74. // if(res.exceptionInfo){
  75. // showError(res.exceptionInfo);return;
  76. // }
  77. // if(res.success){
  78. // alert(' 删除成功!');
  79. // }
  80. // }
  81. // });
  82. // url = "oa/myprocess/getJProcessList.action";
  83. //// url = "oa/myprocess/getMyList.action";
  84. // btn.ownerCt.ownerCt.getGroupData();
  85. // }
  86. }
  87. },{
  88. iconCls: 'x-button-icon-add',
  89. text: '刷新',
  90. id: 'refresh3',
  91. handler: function(btn){
  92. }
  93. }],
  94. initComponent : function(){
  95. this.callParent(arguments);
  96. // url = "oa/myprocess/getJProcessList.action";
  97. // url = "oa/myprocess/getMyList.action";
  98. // this.getGroupData(page, pageSize);
  99. },
  100. listeners: {//滚动条有时候没反应,添加此监听器
  101. scrollershow: function(scroller) {
  102. if (scroller && scroller.scrollEl) {
  103. scroller.clearManagedListeners();
  104. scroller.mon(scroller.scrollEl, 'scroll', scroller.onElScroll, scroller);
  105. }
  106. }
  107. }
  108. });