GridPanel4.js 2.9 KB

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