Problems with grid hierarchy

3 posts, 0 answers
  1. Fernando
    Fernando avatar
    1 posts
    Member since:
    Jan 2012

    Posted 24 Jan 2012 Link to this post

    Hello everybody,

    i'm trying to make one grid with Hierarchy, but the hierarchy grid return all rows everytime.

    To populate the grids, i have two json files:
    -OS.json to principal;
    -ITEM.json to hierarchy grid;

    OS.json:
    [{"cdOS":474103,"cdSelb":"X112","solicitante":"CLEBSON "},
    {"cdOS":474104,"cdSelb":"A335","solicitante":"FERNANDO "}]

    ITEM.json:
    [{"cdOS":474103,"status":"ABERTO","usuario":"nivaldo.oliveira"},
    {"cdOS":474103,"status":"FECHADO","usuario":"carlos.alberto"},
    {"cdOS":474104,"status":"ABERTO","usuario":"nivaldo.oliveira"},
    {"cdOS":474104,"status":"FECHADO","usuario":"carlos.alberto"}]



    <div id="grid"> </div>

                    $(document).ready(function() {
                        var element = $("#grid").kendoGrid({
                            dataSource: {
                                type: "json",
                                pageSize: 10,
                                serverPaging: true,
                                serverFiltering: true,
                                serverSorting: true,
                                transport: {
                                    read: {
                                        url: "js/OS.json",
                                        dataType: "json"
                                    },
                                    schema: {
                                        model: {
                                            fields: {
                                                cdOS: { type: "number" },
                                                cdSelb: { type: "string" },
                                                solicitante: { type: "string" }
                                            }
                                        }
                                    }
                                }
                            },
                            height: 550,
                            filterable: true,
                            sortable: true,
                            pageable: true,
                            detailInit: detailInit,
                            dataBound: function() {
                                this.expandRow(this.tbody.find("tr.k-master-row").first());
                            },
                            columns: [{
                                field: "cdOS",
                                title: "OS"
                            },
                            {
                                field: "cdSelb",
                                title: "SELB"
                            },
                            {
                                field: "solicitante",
                                title: "Solicitante"
                            }]
                            });
                        });

                    function detailInit(e) {
                        $("<div/>").kendoGrid({
                            dataSource: {
                                type: "json",
                                transport: {
                                read: {
                                    url: "js/ITEM.json",
                                    dataType: "json"
                                    },
                                    schema: {
                                        model: {
                                            fields: {
                                                cdOS: { type: "number" },
                                                status: { type: "string" },
                                                usuario: { type: "string" }
                                            }
                                        }
                                    }                                
                                },
                                serverPaging: true,
                                serverSorting: true,
                                serverFiltering: true,
                                pageSize: 6,
                                filter: { field: "cdOS", operator: "eq", value: e.data.cdOS }
                            },
                            scrollable: true,
                            sortable: true,
                            pageable: true,
                            columns: ["cdOS", "status","usuario"]
                        }).appendTo(e.detailCell);
                    }


    Anybody can help-me to resolve this issue?
    I wanna to return only two rows in hierarchy grid, for one row in principal grid, the link is "CdOS".

    Thanks!
  2. Joel
    Joel avatar
    78 posts
    Member since:
    Oct 2012

    Posted 26 Jan 2012 Link to this post

    Can you set this up in a jsfiddle (http://jsfiddle.net/) to reproduce what you are trying to achieve?
  3. Kendo UI is VS 2017 Ready
  4. Umesh
    Umesh avatar
    1 posts
    Member since:
    Mar 2014

    Posted 25 Mar 2014 Link to this post

    Try doing Fetch, group
Back to Top