在收到新信息后,我无法尝试更改数据网格的结构.每次进行查询时,我都需要能够更改列数. 我用来创建网格的javascript代码 function setgrid(){ var gridLayout = []; var key, i; for(i = 0; i 10; i++) { key
我用来创建网格的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);