DataListPanel.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * @Description: 数据列表
  3. * @Author: hy
  4. * @Date: 2019-08-12 18:33:04
  5. * @LastEditTime: 2019-08-13 14:19:02
  6. */
  7. Ext.define('uas.view.grid.dataList.DataListPanel', {
  8. extend: 'Ext.grid.Panel',
  9. xtype: 'dataListPanel',
  10. requires: [
  11. 'uas.view.plugins.gridHeaderFilter.GridHeaderFilter',
  12. 'uas.store.DataListGridStore'
  13. ],
  14. plugins: {
  15. gridHeaderFilter: true
  16. },
  17. emptyText: '无数据',
  18. loadMask: true,
  19. stateful: true,
  20. // Set a stateId so that this grid's state is persisted.
  21. stateId: 'stateful-filter-grid',
  22. store: {
  23. type: 'dataListGridStore',
  24. url: 'data/grid/grid-filter.json',
  25. autoLoad: true,
  26. autoDestroy: true
  27. },
  28. // Dispatch named listener and handler methods to this instance
  29. defaultListenerScope: true,
  30. tbar: {
  31. name:'filterToolbar',
  32. height:46,
  33. items:['->']
  34. },
  35. columns: [{
  36. dataIndex: 'id',
  37. text: 'Id',
  38. width:50,
  39. // Specify that this column has an associated Filter. This is
  40. // processed by the gridfilters plugin. If this is a string,
  41. // this is the type of filter to apply.
  42. // filter: 'number'
  43. }, {
  44. dataIndex: 'company',
  45. text: 'Company',
  46. flex: 1,
  47. // As an object, the type property indicates the type of filter to
  48. // apply. All other properties configure that filter instance.
  49. filter: {
  50. type:'string'
  51. }
  52. }, {
  53. dataIndex: 'price',
  54. text: 'Price',
  55. formatter: 'usMoney',
  56. flex: 1,
  57. filter: {
  58. type:'number'
  59. }
  60. }, {
  61. dataIndex: 'size',
  62. text: 'Size',
  63. flex: 1,
  64. filter: {
  65. type:'combo',
  66. combo:[
  67. ["small", "小"],
  68. ["medium", "中"],
  69. ["large", "大"],
  70. ["extra large", "最大"]
  71. ]
  72. }
  73. }, {
  74. xtype: 'datecolumn',
  75. dataIndex: 'date',
  76. text: 'Date',
  77. flex: 1,
  78. filter: {
  79. type:'date'
  80. }
  81. }, {
  82. dataIndex: 'visible',
  83. text: 'Visible',
  84. flex: 1,
  85. filter: {
  86. type:'combo',
  87. combo:[
  88. ["true", "是"],
  89. ["false", "否"]
  90. ]
  91. }
  92. }]
  93. });