如何在Dojox/Grid/EnhancedGrid中删除列



我们有任何方法可以删除Dojox/Grid/EnhancedGrid中的列。请让我们知道是否有任何解决方案。

请找到我的样品网格。
详细信息:它创建了DOJOX/GRID/ENHANCANDGRID,并具有与单击标头行相关的动作。我可以添加什么操作来删除列?

var dataStore = new ObjectStore({objectStore: objectStoreMemory});
// grid
grid = new EnhancedGrid({
    selectable: true,
    store: dataStore,
    structure : [ {
        name : "Country",
        field : "Country",
        width : "150px",
        reorderable: false,
        editable : true
    }, {
        name : "Abbreviation",
        field : "Abbreviation",
        width : "120px",
        reorderable: false,
        editable : true
    }, {
        name : "Capital",
        field : "Capital",
        width : "100%",
        reorderable: false,
        editable : true
    } ],
    rowSelector: '20px',
    plugins: {
        pagination: {
            pageSizes: ["10", "25", "50", "100"],
            description: true,
            sizeSwitch: true,
            pageStepper: true,
            gotoButton: true,
            maxPageStep: 5,
            position: "bottom"
        }
    },
    dodblclick: function() {
        alert("Header clicked");  
    }
}, "grid");
grid.startup();

您需要使用方法

grid.setStructure(newLayout); 

grid.set('structure',newLayout); 

在这里,newlayout是您需要创建的布局,而无需列。希望这会有所帮助。

最新更新