DataListPanel.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * @Description: 数据列表
  3. * @Author: hy
  4. * @Date: 2019-08-12 18:33:04
  5. * @LastEditTime: 2019-08-13 09:04:44
  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. frame: true,
  15. resizable: true,
  16. plugins: {
  17. gridHeaderFilter: true
  18. },
  19. emptyText: '无数据',
  20. loadMask: true,
  21. stateful: true,
  22. // Set a stateId so that this grid's state is persisted.
  23. stateId: 'stateful-filter-grid',
  24. store: {
  25. type: 'dataListGridStore',
  26. url: 'data/grid/grid-filter.json',
  27. autoLoad: true,
  28. autoDestroy: true
  29. },
  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. flex:1,
  41. // Specify that this column has an associated Filter. This is
  42. // processed by the gridfilters plugin. If this is a string,
  43. // this is the type of filter to apply.
  44. // filter: 'number'
  45. }, {
  46. dataIndex: 'company',
  47. text: 'Company',
  48. flex: 1,
  49. // As an object, the type property indicates the type of filter to
  50. // apply. All other properties configure that filter instance.
  51. filter: {
  52. type:'string'
  53. }
  54. }, {
  55. dataIndex: 'price',
  56. text: 'Price',
  57. formatter: 'usMoney',
  58. flex: 1,
  59. filter: {
  60. type:'number'
  61. }
  62. }, {
  63. dataIndex: 'size',
  64. text: 'Size',
  65. flex: 1,
  66. filter: {
  67. type:'combo',
  68. combo:[
  69. ["small", "小"],
  70. ["medium", "中"],
  71. ["large", "大"],
  72. ["extra large", "最大"]
  73. ]
  74. }
  75. }, {
  76. xtype: 'datecolumn',
  77. dataIndex: 'date',
  78. text: 'Date',
  79. flex: 1,
  80. filter: {
  81. type:'date'
  82. }
  83. }, {
  84. dataIndex: 'visible',
  85. text: 'Visible',
  86. flex: 1,
  87. }]
  88. });