gpt4 book ai didi

dojo - 动态更改 dojo 数据网格结构

转载 作者:行者123 更新时间:2023-12-04 23:03:17 27 4
gpt4 key购买 nike

收到新信息后,我无法尝试更改数据网格的结构。每次进行查询时,我都需要能够更改列数。

我用来创建网格的 javascript 代码

function setgrid(){
var gridLayout = [];
var key, i;
for(i = 0; i < 10; i++) {
key = i + "";
gridLayout.push({
field: key,
name: key,
editable: false
});
}

// create a new grid:
billsGrid = new dojox.grid.DataGrid({
query: {},
//store: store,
clientSort: true,
rowSelector: '20px',
structure: gridLayout,
columnReordering: true
}, gridContainer);

// Call startup, in order to render the grid:
billsGrid.startup();
}

和 html:
<div id="gridContainer" style="width: 650px; height: 600px; border: 1px solid silver;" />

我将如何更改网格以具有 5 列的新布局?

最佳答案

找到了,只需要知道调用什么来将新布局应用到现有网格。在这种情况下:billsGrid.setStructure(newLayout);

关于dojo - 动态更改 dojo 数据网格结构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4374016/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com