1. #1
    Sencha User
    Join Date
    Jan 2013
    Posts
    1
    Vote Rating
    0
    lalitphp is on a distinguished road

      0  

    Default Unanswered: Locked & stateful both are not working at same time?

    Unanswered: Locked & stateful both are not working at same time?


    I am newbie for Ext js, In the Grid I want both type of functionality locked column and stateful..But when I activate both cookies are not working for stateful.. If I removed locked=true from column then stateful is working as it should...grid.png
    Code:
         
        Ext.onReady(function() {
             Ext.state.Manager.setProvider(new Ext.state.CookieProvider({
               expires: new Date(new Date().getTime()+(1000*60*60*24*7)), //7 days from now
            }));
    
            var store = new Ext.data.JsonStore({
                // store configs
                storeId: 'myStore',
                autoLoad: true,
                proxy: {
                    type: 'ajax',
                    loadMask: true,
                    url: 'read_form/getEmployee.php',
                    reader: {
                        type: 'json',
                        root: 'results',
                        idProperty: 'hoten'
                    }
                },
                //alternatively, a Ext.data.Model name can be given (see Ext.data.Store for an example)
                fields: ['hoten','CoBan','ThoiVu','Khac','thunhapchiuthue','baohiem','npt','giamtru','thunhaptinhthue','thue','thueduocgiam','thuephainop','dakhautru']
            });
    
            
            var selModel = Ext.create('Ext.selection.CheckboxModel', {
                listeners: {
                    selectionchange: function(sm, selections) {
                        grid.down('#removeButton').setDisabled(selections.length == 0);
                    }
                }
            });
    
            // create the grid
            var grid =Ext.create('Ext.grid.Panel', {
                store: store,
                columns: [
                Ext.create('Ext.grid.RowNumberer'),
                { text: "Họ tên",  width: 60, dataIndex: 'hoten',  locked : true, sortable: true, id: 'hoten' },
                { text: 'Thu nhập chịu thuế',
                columns: [
                { text: "Cơ bản",  width: 60,  dataIndex: 'CoBan', sortable: true,summaryType: 'sum' },
                { text: "Thời vụ", width: 60, dataIndex: 'ThoiVu',   sortable: true ,summaryType: 'sum'},
                { text: "Khác",  width: 60, dataIndex: 'Khac', sortable: true,summaryType: 'sum' },
                { text: "Tổng",  width: 60, dataIndex: 'thunhapchiuthue', sortable: true ,summaryType: 'sum'}
                ]},
                { text: 'Giảm trừ',
                columns: [
                { text: "Bảo hiểm",   width: 60, dataIndex: 'baohiem', sortable: true },
                { text: "NPT",   width: 60, dataIndex: 'npt', sortable: true },
                { text: "Tổng",   width: 60, dataIndex: 'giamtru', sortable: true }]},
                { text: "Thu nhập tính thuế",  width: 100, dataIndex: 'thunhaptinhthue', sortable: true, id: 'thunhaptinhthue1'  },
                { text: "Thuế phát sinh",  width: 100, dataIndex: 'thue', sortable: true, id: 'thunhaptinhthue2' },
                { text: "Giảm thuế",  width: 70, dataIndex: 'thueduocgiam', sortable: true, id: 'thunhaptinhthue3' },
                { text: "Thuế phải khấu trừ", width: 100,  dataIndex: 'thuephainop', sortable: true },
            ],
            columnLines: true,
            selModel: selModel,
            stateful: true,
            stateId: 'stateGrid1',
            // inline buttons
            dockedItems: [{
                xtype: 'toolbar',
                items: [{
                    text:'Add Something',
                    tooltip:'Add a new row',
                    iconCls:'add'
                },'-',{
                    itemId: 'removeButton',
                    text:'Remove Something',
                    tooltip:'Remove the selected item',
                    iconCls:'remove',
                    disabled: true
                },
                ]
            }],
            renderTo: 'example-grid',
            width: 680,
            height: 200,
            frame: true,
            iconCls: 'icon-grid'
            });
        });
    Thanks in advance......

  2. #2
    Touch Premium Member
    Join Date
    Feb 2011
    Location
    NJ
    Posts
    311
    Answers
    59
    Vote Rating
    51
    droessner is a jewel in the rough droessner is a jewel in the rough droessner is a jewel in the rough

      1  

Thread Participants: 1

Tags for this Thread