崩溃时禁用更新并展开treegrid extjs 4

时间:2012-11-28 04:49:23

标签: extjs4

我有treegrid extjs 4 ..我使用代理读取,创建,更新和删除 但问题是当我单击折叠并在treegrid中展开时,treegrid总是发送更新。 当我删除更新代理时,我崩溃失败了..

任何人都有想法在折叠和扩展时禁用更新?

这是我的短代码

Ext.define('storeLapObjTP', {
    extend: 'Ext.data.TreeStore',    
//storePlanningTP = Ext.create('Ext.data.TreeStore', {
    pageSize:50,
    autoSync: true,
    model: 'mod_planningTP',
    method: 'POST',
    proxy: {
        type: 'ajax',
        api: {
            read: base_url+'project/getcomplete',
            create: base_url+'project/edit/'+'create',
            update: base_url+'project/edit/'+'update',
            destroy: base_url+'project/edit/'+'delete'
        },
        reader: {
            type: 'json',
        }
    },
    sorters: [{
        property: 'id',
        direction: 'desc'
    }],
});


Ext.define('gridTPcl', {
    extend: 'Ext.tree.Panel',
    id:'gridLapTP',
    store: storeLapTP = new storeLapObjTP,
    collapsible: false,
    loadMask: true,
    region: 'center',
    margins: '0 0 0 0',
    autoScroll: false,
    useArrows: true,
    rootVisible: true,
    multiSelect: false,
    singleExpand: false,
    columns: 
        [
        {
            menuDisabled: true,
            sortable: false,
            xtype: 'actioncolumn',
            width: 20,
            items: [
        {
            xtype: 'treecolumn',
            header: 'Project Name',
            dataIndex: 'name',
            width: 300,
            align: 'left',
        },
        {
            header: 'Id',
            dataIndex: 'id',
            hidden:true
        },{
            text:'Anggaran (Rp.000)',
            columns : [
                {
                    header: 'Budget',
                    dataIndex: 'budget',
                    width:80,
                    align: 'center',
                }, {
                    header: 'Total',
                    dataIndex: 'total',
                    width:80,
                    align: 'center',
                }
            ]
        }],
    selModel: {
        selType: 'rowmodel'
    },
    title: 'Project Tree',
    frame: false,
    tbar: new Ext.Toolbar({
        id: 'tbarlaptp',
        items: [
        comboYearLapTP,'-',comboYearLapTP,'-',{
            id : 'reloadbuttonlaptp',
            text: 'Reload',
            iconCls: 'reloadButton',
            disabled: true,
            tooltip: 'Reload Data and Ignore Change',
            handler : function(){
                this.up().up().store.load();
            }
        }]
    })
    ,
    plugins: [],
});

0 个答案:

没有答案