DataListPanel.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * @Description: 数据列表
  3. * @Author: hy
  4. * @Date: 2019-08-12 18:33:04
  5. * @LastEditTime: 2019-08-15 10:55:22
  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. locked: true
  44. // Specify that this column has an associated Filter. This is
  45. // processed by the gridfilters plugin. If this is a string,
  46. // this is the type of filter to apply.
  47. // filter: 'number'
  48. }, {
  49. dataIndex: 'company',
  50. text: 'Company',
  51. flex: 1,
  52. locked: true,
  53. // As an object, the type property indicates the type of filter to
  54. // apply. All other properties configure that filter instance.
  55. filter: {
  56. type:'string'
  57. }
  58. }, {
  59. dataIndex: 'price',
  60. text: 'Price',
  61. formatter: 'usMoney',
  62. flex: 1,
  63. filter: {
  64. type:'number'
  65. }
  66. }, {
  67. dataIndex: 'size',
  68. text: 'Size',
  69. flex: 1,
  70. filter: {
  71. type:'combo',
  72. combo:[
  73. ["small", "小"],
  74. ["medium", "中"],
  75. ["large", "大"],
  76. ["extra large", "最大"]
  77. ]
  78. }
  79. }, {
  80. xtype: 'datecolumn',
  81. dataIndex: 'date',
  82. text: 'Date',
  83. flex: 1,
  84. filter: {
  85. type:'date'
  86. }
  87. }, {
  88. dataIndex: 'visible',
  89. text: 'Visible',
  90. flex: 1,
  91. filter: {
  92. type:'combo',
  93. combo:[
  94. ["true", "是"],
  95. ["false", "否"]
  96. ]
  97. }
  98. }]
  99. });