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