0

我有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: [],
});
4

0 回答 0