1
我想在我的网页中刷新一个dojo网格。我尝试了在dojotoolkit.org中给出的.refresh,但没有成功。有没有其他方便的方法来做清爽?提前致谢。使用dojo刷新网格
我想在我的网页中刷新一个dojo网格。我尝试了在dojotoolkit.org中给出的.refresh,但没有成功。有没有其他方便的方法来做清爽?提前致谢。使用dojo刷新网格
也许这有助于。这是我刷新网格的方式:
if(!registry.byId("GraphGrid")){
var grid = new EnhancedGrid({
id: 'GraphGrid',
store: GraphicStore,
query: { ident: "*" },
structure: layout,
rowSelector: '20px',
plugins: {
indirectSelection: {
headerSelector:true,
width:"40px",
styles:"text-align: center;"
}}
},"GridGraphicInMap");
/*Call startup() to render the grid*/
grid.startup();
dojo.connect(grid, "onRowClick", grid, function(evt){
var idx = evt.rowIndex,
item = this.getItem(idx);
// get a value out of the item
var value = this.store.getValue(item, "geom");
highlightGeometry(value,true);
// do something with the value.
});
}
else {
registry.byId("GraphGrid").setStore(GraphicStore);
}
当我第一次调用我的函数时,会生成网格。 Evrytime我稍后调用该函数,只有商店被刷新。
此致,Miriam
在此代码中刷新的关键是重置商店。顺便说一下,'dojox/grid'中的网格已被弃用;如果你开始新的东西,替换是[dgrid](http://dgrid.io)(推荐)或[gridx](https://github.com/oria/gridx)。 –
谢谢你们两个:)它有帮助 – Amila