Dojo + DataGrid + JsonRest + json personalizado

I have following problem. My REST web service returns json like this one:


How can I force DataGrid to display items from json above? I can't change REST web service, it must return jsons in this format. Http request is ok and server returns my json, but datagrid is not filled in. ¿Tiene alguna idea?

My "dojo" code is below:

        var store = new Cache(new JsonRest({
            target: settings.vars.API_URL + "/frapi/users/load",
            start: page * rows,
                count: 10,
                sort: [
                    {attribute: "id", descending: true}
                headers: {
                    "Content-Type": "application/json"
        }), Memory());

        grid = new DataGrid({
            store: new ObjectStore({objectStore: store}),
            queryOptions: {},
                defaultCell: {
                    width: "auto"
                cells: [
                    {name: "Id", field: "id", width: "50px"},
                    {name: "Login", field: "login"},
                    {name: "Email", field: "email", width: "200px"},
                    {name: "Firstname", field: "firstname"},
                    {name: "Lastname", field: "lastname"}
        }, "grid");


Gracias por adelantado

preguntado el 09 de septiembre de 13 a las 21:09

1 Respuestas

OK, I found solution. Please see code below:

    var extractItemsFromResponse = function(deferred) {
        return deferred.then(function(response) {
            return response.response.items.item;

    aspect.after(store, "query", extractItemsFromResponse);

Espero que te ayude.

Respondido el 10 de Septiembre de 13 a las 11:09

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.