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();**
精彩评论