Panel.js 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. Ext.define('uas.view.grid.bigData.Panel', {
  2. extend: 'Ext.grid.Panel',
  3. xtype: 'big-data-grid',
  4. controller: 'bigdata',
  5. requires: [
  6. 'Ext.grid.filters.Filters',
  7. 'Ext.sparkline.Line',
  8. 'Ext.ux.rating.Picker'
  9. ],
  10. store: 'BigData',
  11. columnLines: true,
  12. multiColumnSort: true,
  13. features: [{
  14. ftype : 'groupingsummary',
  15. groupHeaderTpl : '{name}',
  16. hideGroupedHeader : false,
  17. enableGroupingMenu : false
  18. }, {
  19. ftype: 'summary',
  20. dock: 'bottom'
  21. }],
  22. layout: 'border',
  23. split: true,
  24. lockedGridConfig: {
  25. title: 'Employees',
  26. header: false,
  27. collapsible: true,
  28. width: 325,
  29. minWidth: 290,
  30. forceFit: true
  31. },
  32. selModel: {
  33. type: 'checkboxmodel',
  34. checkOnly: true
  35. },
  36. columns:[{
  37. xtype: 'rownumberer',
  38. width: 120,
  39. sortable: false,
  40. locked: true,
  41. summaryType: 'count',
  42. summaryRenderer: function(value, summaryData, dataIndex) {
  43. return Ext.String.format('共有{0}条数据', value);
  44. }
  45. }, {
  46. text: 'Id',
  47. sortable: true,
  48. dataIndex: 'employeeNo',
  49. groupable: false,
  50. width: 80,
  51. locked: true,
  52. editRenderer: 'bold'
  53. }, {
  54. text: 'Name (Filter)',
  55. dataIndex: 'name',
  56. sortable: true,
  57. sorter: {
  58. sorterFn: 'nameSorter' // set controller
  59. },
  60. width: 140,
  61. groupable: false,
  62. layout: 'hbox',
  63. locked: true,
  64. renderer: 'concatNames',
  65. editor: {
  66. xtype: 'textfield'
  67. },
  68. items: {
  69. xtype: 'textfield',
  70. fieldStyle: "",
  71. reference: 'nameFilterField',
  72. flex : 1,
  73. margin: 2,
  74. enableKeyEvents: true,
  75. listeners: {
  76. keyup: 'onNameFilterKeyup',
  77. buffer: 500
  78. }
  79. }
  80. }, {
  81. text: 'Rating',
  82. width: 100,
  83. sortable: true,
  84. dataIndex: 'rating',
  85. groupable: false,
  86. xtype: 'widgetcolumn',
  87. widget: {
  88. xtype: 'sparklineline'
  89. }
  90. }, {
  91. text: 'Date of birth',
  92. dataIndex: 'dob',
  93. xtype: 'datecolumn',
  94. groupable: false,
  95. width: 115,
  96. filter: {
  97. },
  98. editor: {
  99. xtype: 'datefield'
  100. },
  101. exportStyle: {
  102. alignment: {
  103. horizontal: 'Right'
  104. },
  105. format: 'Long Date'
  106. }
  107. }, {
  108. text: 'Join date',
  109. dataIndex: 'joinDate',
  110. xtype: 'datecolumn',
  111. groupable: false,
  112. width: 120,
  113. filter: {
  114. },
  115. editor: {
  116. xtype: 'datefield'
  117. },
  118. exportStyle: {
  119. alignment: {
  120. horizontal: 'Right'
  121. },
  122. format: 'Long Date'
  123. }
  124. }, {
  125. text: 'Notice<br>period',
  126. dataIndex: 'noticePeriod',
  127. groupable: false,
  128. width: 115,
  129. filter: {
  130. type: 'list'
  131. },
  132. editor: {
  133. xtype: 'combobox',
  134. listeners: {
  135. beforerender: 'onBeforeRenderNoticeEditor'
  136. }
  137. }
  138. }, {
  139. text: 'Email address',
  140. dataIndex: 'email',
  141. width: 200,
  142. groupable: false,
  143. renderer: 'renderMailto',
  144. editor: {
  145. xtype: 'textfield'
  146. }
  147. }, {
  148. text: 'Department',
  149. dataIndex: 'department',
  150. hidden: true,
  151. hideable: false,
  152. filter: {
  153. type: 'list'
  154. }
  155. }, {
  156. text: 'Absences',
  157. shrinkWrap: true,
  158. columns: [{
  159. text: 'Illness',
  160. dataIndex: 'sickDays',
  161. width: 100,
  162. groupable: false,
  163. summaryType: 'sum',
  164. summaryFormatter: 'number("0")',
  165. filter: {
  166. },
  167. editor: {
  168. xtype: 'numberfield',
  169. decimalPrecision: 0
  170. }
  171. }, {
  172. text: 'Holidays',
  173. dataIndex: 'holidayDays',
  174. width: null, // Size column to title text
  175. groupable: false,
  176. summaryType: 'sum',
  177. summaryFormatter: 'number("0")',
  178. filter: {
  179. },
  180. editor: {
  181. xtype: 'numberfield',
  182. decimalPrecision: 0
  183. }
  184. }, {
  185. text: 'Holiday Allowance',
  186. dataIndex: 'holidayAllowance',
  187. width: null, // Size column to title text
  188. groupable: false,
  189. summaryType: 'sum',
  190. summaryFormatter: 'number("0.00")',
  191. formatter: 'number("0.00")',
  192. filter: {
  193. },
  194. editor: {
  195. xtype: 'numberfield',
  196. decimalPrecision: 0
  197. }
  198. }]
  199. }, {
  200. text: 'Rating<br>This Year',
  201. dataIndex: 'ratingThisYear',
  202. groupable: false,
  203. xtype: 'widgetcolumn',
  204. widget: {
  205. xtype: 'rating',
  206. tip: 'Set to {tracking:plural("Star")}'
  207. }
  208. }, {
  209. text: 'Salary',
  210. width: 155,
  211. sortable: true,
  212. dataIndex: 'salary',
  213. align: 'right',
  214. formatter: 'usMoney',
  215. groupable: false,
  216. summaryType: 'average',
  217. summaryFormatter: 'usMoney',
  218. filter: {
  219. },
  220. editor: {
  221. xtype: 'numberfield',
  222. decimalPrecision: 2
  223. },
  224. exportStyle: {
  225. alignment: {
  226. horizontal: 'Right'
  227. },
  228. format: 'Currency'
  229. }
  230. }],
  231. viewConfig: {
  232. stripeRows: true
  233. },
  234. plugins: {
  235. gridfilters: true,
  236. rowexpander: {
  237. // dblclick invokes the row editor
  238. expandOnDblClick: false,
  239. rowBodyTpl: '<img src="{avatar}" height="100px" '+
  240. 'style="float:left;margin:0 10px 5px 0"><b>{name}<br></b>{dob:date}'
  241. }
  242. }
  243. });