开发者

Updating dojox.grid.DataGrid

I have a dojox.grid.DataGrid configured and I want to populate a data grid with different values when a 开发者_C百科user clicks a button.

I have tried the following code but it does not work:

var employees2 = [
  {name:"Jane", department:"engineering"},
  {name:"Mary", department:"engineering"},
  {name:"Julie", department:"sales"}
];

console.info("grid is "+grid.toString());
employeeStore2 = new dojo.store.Memory({data:employees2, idProperty: "name"});

grid.setStore(employeeStore2);

employeeStore2.close();

I have setup the example here: http://jsfiddle.net/nonie/kx72T/

Any help would be great.


In your example, the event onclick button doesn't work....

I think in showList2 method, you should write something like this

**employeeStore2 = new dojo.store.Memory({
    data: employees2,
    idProperty: "name"
});

grid.setStore(dojo.data.ObjectStore({objectStore: employeeStore2}));
grid.update();**
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜