123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- Ext.define('uas.view.grid.bigData.Panel', {
- extend: 'Ext.grid.Panel',
- xtype: 'big-data-grid',
- controller: 'bigdata',
- requires: [
- 'Ext.grid.filters.Filters',
- 'Ext.sparkline.Line',
- 'Ext.ux.rating.Picker'
- ],
- store: {
- type: 'big-data',
- remoteSort: true,
- autoLoad: true
- },
- columnLines: true,
- multiColumnSort: true,
- features: [{
- ftype : 'groupingsummary',
- groupHeaderTpl : '{name}',
- hideGroupedHeader : false,
- enableGroupingMenu : false
- }, {
- ftype: 'summary',
- dock: 'bottom'
- }],
- layout: 'border',
- split: true,
- lockedGridConfig: {
- title: 'Employees',
- header: false,
- collapsible: true,
- width: 325,
- minWidth: 290,
- forceFit: true
- },
- selModel: {
- type: 'checkboxmodel',
- checkOnly: true
- },
- columns:[{
- xtype: 'rownumberer',
- width: 120,
- sortable: false,
- locked: true,
- summaryType: 'count',
- summaryRenderer: function(value, summaryData, dataIndex) {
- return Ext.String.format('共有{0}条数据', value);
- }
- }, {
- text: 'Id',
- sortable: true,
- dataIndex: 'employeeNo',
- groupable: false,
- width: 80,
- locked: true,
- editRenderer: 'bold'
- }, {
- text: 'Name (Filter)',
- dataIndex: 'name',
- sortable: true,
- sorter: {
- sorterFn: 'nameSorter' // set controller
- },
- width: 140,
- groupable: false,
- layout: 'hbox',
- locked: true,
- renderer: 'concatNames',
- editor: {
- xtype: 'textfield'
- },
- items: {
- xtype: 'textfield',
- fieldStyle: "",
- reference: 'nameFilterField',
- flex : 1,
- margin: 2,
- enableKeyEvents: true,
- listeners: {
- keyup: 'onNameFilterKeyup',
- buffer: 500
- }
- }
- }, {
- text: 'Rating',
- width: 100,
- sortable: true,
- dataIndex: 'rating',
- groupable: false,
- xtype: 'widgetcolumn',
- widget: {
- xtype: 'sparklineline'
- }
- }, {
- text: 'Date of birth',
- dataIndex: 'dob',
- xtype: 'datecolumn',
- groupable: false,
- width: 115,
- filter: {
- },
- editor: {
- xtype: 'datefield'
- },
- exportStyle: {
- alignment: {
- horizontal: 'Right'
- },
- format: 'Long Date'
- }
- }, {
- text: 'Join date',
- dataIndex: 'joinDate',
- xtype: 'datecolumn',
- groupable: false,
- width: 120,
- filter: {
- },
- editor: {
- xtype: 'datefield'
- },
- exportStyle: {
- alignment: {
- horizontal: 'Right'
- },
- format: 'Long Date'
- }
- }, {
- text: 'Notice<br>period',
- dataIndex: 'noticePeriod',
- groupable: false,
- width: 115,
- filter: {
- type: 'list'
- },
- editor: {
- xtype: 'combobox',
- listeners: {
- beforerender: 'onBeforeRenderNoticeEditor'
- }
- }
- }, {
- text: 'Email address',
- dataIndex: 'email',
- width: 200,
- groupable: false,
- renderer: 'renderMailto',
- editor: {
- xtype: 'textfield'
- }
- }, {
- text: 'Department',
- dataIndex: 'department',
- hidden: true,
- hideable: false,
- filter: {
- type: 'list'
- }
- }, {
- text: 'Absences',
- shrinkWrap: true,
- columns: [{
- text: 'Illness',
- dataIndex: 'sickDays',
- width: 100,
- groupable: false,
- summaryType: 'sum',
- summaryFormatter: 'number("0")',
- filter: {
- },
- editor: {
- xtype: 'numberfield',
- decimalPrecision: 0
- }
- }, {
- text: 'Holidays',
- dataIndex: 'holidayDays',
- width: null, // Size column to title text
- groupable: false,
- summaryType: 'sum',
- summaryFormatter: 'number("0")',
- filter: {
- },
- editor: {
- xtype: 'numberfield',
- decimalPrecision: 0
- }
- }, {
- text: 'Holiday Allowance',
- dataIndex: 'holidayAllowance',
- width: null, // Size column to title text
- groupable: false,
- summaryType: 'sum',
- summaryFormatter: 'number("0.00")',
- formatter: 'number("0.00")',
- filter: {
- },
- editor: {
- xtype: 'numberfield',
- decimalPrecision: 0
- }
- }]
- }, {
- text: 'Rating<br>This Year',
- dataIndex: 'ratingThisYear',
- groupable: false,
- xtype: 'widgetcolumn',
- widget: {
- xtype: 'rating',
- tip: 'Set to {tracking:plural("Star")}'
- }
- }, {
- text: 'Salary',
- width: 155,
- sortable: true,
- dataIndex: 'salary',
- align: 'right',
- formatter: 'usMoney',
- groupable: false,
- summaryType: 'average',
- summaryFormatter: 'usMoney',
- filter: {
- },
- editor: {
- xtype: 'numberfield',
- decimalPrecision: 2
- },
- exportStyle: {
- alignment: {
- horizontal: 'Right'
- },
- format: 'Currency'
- }
- }],
- viewConfig: {
- stripeRows: true
- },
- plugins: {
- gridfilters: true,
- rowexpander: {
- // dblclick invokes the row editor
- expandOnDblClick: false,
- rowBodyTpl: '<img src="{avatar}" height="100px" '+
- 'style="float:left;margin:0 10px 5px 0"><b>{name}<br></b>{dob:date}'
- }
- }
- });
|