hello am using grid to display dynamic data dojo, but what I get is that sample (n) times, but always shows me the last record, but if I do it with dummy data works well, I hope you help me with this issue.
define(["js/module/modControllerPersona", "dojo/store/Memory", "gridx/Grid", "gridx/core/model/cache/Sync", "dojo/data/ObjectStore"],
function(modControllerPersona, Store, Grid, Cache, ObjectStore){
var grid, store, data;
var persona = new Array();
return{
datagridx: function(){
modControllerPersona.persona().then(function(result){
persona = JSON.parse(result);
data = persona.items;
store = new Store({data: data});
var columns = [
{name: 'id', field: 'descripcion'},
{name: 'descripcion', field: 'id_Maquinaria'},
{name: 'descripcion', field: 'id_tipo_Maquinaria'},
{name: 'Nombre', field: 'kind'},
{name: 'Nombre', field: 'nombre'},
{name: 'Nombre', field: 'visible'}
];
grid = new Grid({
cacheClass: Cache,
store: store,
structure:columns
}, 'gridNode');
grid.startup();
});
Perhaps this can help you, I had a similar problem. If you don't have a column id it doesn't work right. But if you adjust your store to something like this:
Perhaps the "new Memory" is not necassary. In my case this works (but I didn't tested it here again). I have no id but I have another unique field instead of this. I suppose it is because of your
If you use instead of "descripcion" the name "id" I think it should work too.