DataListPanel.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. * @Description: 数据列表
  3. * @Author: hy
  4. * @Date: 2019-08-12 18:33:04
  5. * @LastEditTime: 2019-08-15 08:55:14
  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. viewModel:{
  23. stores: {
  24. dataListGridStore:{
  25. type: 'dataListGridStore',
  26. autoLoad: true,
  27. autoDestroy: true
  28. }
  29. },
  30. },
  31. bind:'{dataListGridStore}',
  32. // Dispatch named listener and handler methods to this instance
  33. defaultListenerScope: true,
  34. tbar: {
  35. name:'filterToolbar',
  36. height:46,
  37. items:['->']
  38. },
  39. columns: [{
  40. dataIndex: 'id',
  41. text: 'Id',
  42. width:50,
  43. // Specify that this column has an associated Filter. This is
  44. // processed by the gridfilters plugin. If this is a string,
  45. // this is the type of filter to apply.
  46. // filter: 'number'
  47. }, {
  48. dataIndex: 'company',
  49. text: 'Company',
  50. flex: 1,
  51. // As an object, the type property indicates the type of filter to
  52. // apply. All other properties configure that filter instance.
  53. filter: {
  54. type:'string'
  55. }
  56. }, {
  57. dataIndex: 'price',
  58. text: 'Price',
  59. formatter: 'usMoney',
  60. flex: 1,
  61. filter: {
  62. type:'number'
  63. }
  64. }, {
  65. dataIndex: 'size',
  66. text: 'Size',
  67. flex: 1,
  68. filter: {
  69. type:'combo',
  70. combo:[
  71. ["small", "小"],
  72. ["medium", "中"],
  73. ["large", "大"],
  74. ["extra large", "最大"]
  75. ]
  76. }
  77. }, {
  78. xtype: 'datecolumn',
  79. dataIndex: 'date',
  80. text: 'Date',
  81. flex: 1,
  82. filter: {
  83. type:'date'
  84. }
  85. }, {
  86. dataIndex: 'visible',
  87. text: 'Visible',
  88. flex: 1,
  89. filter: {
  90. type:'combo',
  91. combo:[
  92. ["true", "是"],
  93. ["false", "否"]
  94. ]
  95. }
  96. }]
  97. });