DataListPaging.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. Ext.define('uas.view.grid.dataList.DataListPaging', {
  2. extend: 'Ext.toolbar.Paging',
  3. xtype: 'dataListPaging',
  4. cls:'x-dataListPaging',
  5. height: 36,
  6. dock: 'bottom',
  7. displayInfo: false,
  8. emptyMsg: "无数据",
  9. items:['->',{
  10. cls:'x-dl-paging-combo',
  11. labelWidth:60,
  12. width:150,
  13. value:100,
  14. labelAlgin:'right',
  15. xtype:'combo',
  16. editable:false,
  17. fieldLabel:'每页显示',
  18. store:[[
  19. '100',100
  20. ],[
  21. '200',200
  22. ],[
  23. '500',500
  24. ],[
  25. '1000',1000
  26. ]],
  27. listeners:{
  28. change:function(me,newValue){
  29. const store = me.ownerCt.ownerCt.store;
  30. store.setPageSize(newValue);
  31. store.loadPage(1)
  32. }
  33. }
  34. },{
  35. cls:'x-dl-paging-display',
  36. xtype:'displayfield',
  37. value:'行/共*行'
  38. }],
  39. getPagingItems: function() {
  40. var me = this,
  41. inputListeners = {
  42. scope: me,
  43. blur: me.onPagingBlur
  44. };
  45. inputListeners[Ext.supports.SpecialKeyDownRepeat ? 'keydown' : 'keypress'] = me.onPagingKeyDown;
  46. return [
  47. {
  48. itemId: 'first',
  49. tooltip: me.firstText,
  50. overflowText: me.firstText,
  51. iconCls: Ext.baseCSSPrefix + 'tbar-page-first',
  52. disabled: true,
  53. handler: me.moveFirst,
  54. scope: me
  55. },
  56. {
  57. itemId: 'prev',
  58. tooltip: me.prevText,
  59. overflowText: me.prevText,
  60. iconCls: Ext.baseCSSPrefix + 'tbar-page-prev',
  61. disabled: true,
  62. handler: me.movePrevious,
  63. scope: me
  64. },
  65. '-',
  66. me.beforePageText,
  67. {
  68. xtype: 'numberfield',
  69. itemId: 'inputItem',
  70. name: 'inputItem',
  71. cls: Ext.baseCSSPrefix + 'tbar-page-number',
  72. allowDecimals: false,
  73. minValue: 1,
  74. hideTrigger: true,
  75. enableKeyEvents: true,
  76. keyNavEnabled: false,
  77. selectOnFocus: true,
  78. submitValue: false,
  79. // mark it as not a field so the form will not catch it when getting fields
  80. isFormField: false,
  81. width: me.inputItemWidth,
  82. margin: '-1 2 3 2',
  83. listeners: inputListeners
  84. },
  85. {
  86. xtype: 'tbtext',
  87. itemId: 'pageCountItem',
  88. html: Ext.String.format(me.afterPageText, '*')
  89. },
  90. '-',
  91. {
  92. itemId: 'next',
  93. tooltip: me.nextText,
  94. overflowText: me.nextText,
  95. iconCls: Ext.baseCSSPrefix + 'tbar-page-next',
  96. disabled: true,
  97. handler: me.moveNext,
  98. scope: me
  99. },
  100. {
  101. itemId: 'last',
  102. tooltip: me.lastText,
  103. overflowText: me.lastText,
  104. iconCls: Ext.baseCSSPrefix + 'tbar-page-last',
  105. disabled: true,
  106. handler: me.moveLast,
  107. scope: me
  108. },
  109. '-',
  110. {
  111. itemId: 'refresh',
  112. tooltip: me.refreshText,
  113. overflowText: me.refreshText,
  114. iconCls: Ext.baseCSSPrefix + 'tbar-loading',
  115. disabled: me.store.isLoading(),
  116. handler: me.doRefresh,
  117. scope: me
  118. }
  119. ];
  120. },
  121. });