DataListPanel.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. ],
  12. plugins: {
  13. gridHeaderFilter: true
  14. },
  15. emptyText: '无数据',
  16. loadMask: true,
  17. stateful: true,
  18. // Set a stateId so that this grid's state is persisted.
  19. stateId: 'stateful-filter-grid',
  20. viewModel:{
  21. stores: {
  22. dataListGridStore:{
  23. type: 'dataListGridStore',
  24. autoLoad: true,
  25. autoDestroy: true
  26. }
  27. },
  28. },
  29. bind:'{dataListGridStore}',
  30. // Dispatch named listener and handler methods to this instance
  31. defaultListenerScope: true,
  32. tbar: {
  33. name:'filterToolbar',
  34. height:46,
  35. items:['->']
  36. },
  37. columns: [{
  38. dataIndex: 'id',
  39. text: 'Id',
  40. width:50,
  41. locked: true
  42. // Specify that this column has an associated Filter. This is
  43. // processed by the gridfilters plugin. If this is a string,
  44. // this is the type of filter to apply.
  45. // filter: 'number'
  46. }, {
  47. dataIndex: 'company',
  48. text: 'Company',
  49. flex: 1,
  50. locked: true,
  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. });