如何删除dojox / grid / EnhancedGrid中的列

时间:2017-12-13 17:08:40

标签: dojox.grid

我们有没有办法删除dojox / grid / EnhancedGrid中的列。如果有任何解决方案,请告诉我们。

请找到我的样本网格 详细信息:它创建一个dojox / grid / EnhancedGrid,并具有与单击标题行相关联的操作。我可以添加哪些操作来删除列?

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();

1 个答案:

答案 0 :(得分:0)

您需要使用方法

grid.setStructure(newLayout); 

grid.set('structure',newLayout); 

这里newLayout是您需要在没有所需列的情况下创建的布局。 希望这会有所帮助。

相关问题