dojox grid 动态添加一行 itcpBillgridstoreput 之后不显示
如果您使用dojox.grid来动态添加一行,但是添加后不显示,可能是因为您没有更新grid的显示。当您使用store.put({})来添加一行时,您需要调用grid的render()方法来更新显示。
示例代码如下:
var grid = new dojox.grid.DataGrid({
// grid的配置
});
var store = new dojox.data.JsonRestStore({
// store的配置
});
grid.setStore(store);
// 动态添加一行
store.put({}).then(function() {
// 更新grid的显示
grid.render();
}, function(error) {
console.error(error);
});
在上述示例中,我们首先创建了一个dojox.grid.DataGrid实例和一个dojox.data.JsonRestStore实例,并将store设置为grid的数据源。
然后,我们使用store.put({})来添加一行,并在添加完成后调用grid的render()方法来更新显示。
希望这可以帮助到您
原文地址: https://www.cveoy.top/t/topic/ihzK 著作权归作者所有。请勿转载和采集!