EXT gridGroup

4867 단어 group
            Ext.define('Task', {

                extend: 'Ext.data.Model',

                idProperty: 'id',

                fields: [

                    { name: 'Customer_name', type: 'string' },

                    { name: 'Follow', type: 'string' },

                    { name: 'Follow_Type', type: 'string' },

                    { name: 'department_name', type: 'string' },

                    { name: 'employee_name', type: 'string' },

                    { name: 'Follow_date', type: 'date', dateFormat: 'Y-d-m' }

                ]

            });

            var store = Ext.create('Ext.data.Store', {

                model: 'Task',

                pageSize: 20, 

                remoteSort: false,

                remoteFilter: true,

                proxy: {

                    type: 'ajax',

                    url: '/data/customer/FollowHandler.ashx?action=personGrid',

                    reader: {

                        type: 'json', 

                        root: 'rows', 

                        totalProperty: 'total' 

                    }

                },

                sorters: [

                    {

                        property: 'id',

                        direction: 'desc'

                    }

                ],

                groupField: 'Customer_name',// 

                autoLoad: true

            });


  
var grid = Ext.create('Ext.grid.Panel', {

                id: 'PersonContactsList_grid',

                floatable: false,

                border: false,

                store: store,

                reload: true,

                bbar: pagebbar,

                title: ' ',

                features: [{// 

                    id: 'persongroup',

                    ftype: 'groupingsummary',

                    groupHeaderTpl: '{name}',

                    hideGroupedHeader: true,

                    enableGroupingMenu: false,

                    startCollapsed: true

                }],

                columns: [{

                    text: ' ',

                    width: 600,

                    locked: true,

                    tdCls: 'task',

                    sortable: true,

                    dataIndex: 'Follow',

                    hideable: false,

                    summaryType: 'count',

                    summaryRenderer: function (value, summaryData, dataIndex) {// 

                        return ((value === 0 || value > 1) ? '(' + value + '  )' : '(1  )');

                    },

                    renderer: function (value, meta, record) {

                        return '<div style="white-space:normal;overflow: visible;">' + value + '</div>';

                    }

                },

                    {

                        text: " ",

                        width: 200,

                        dataIndex: 'Customer_name'

                    },
...............

좋은 웹페이지 즐겨찾기