1
votes

I would like to use Hierarchy Grid which is containing data from read request.

http://demos.telerik.com/kendo-ui/grid/hierarchy

Problem is that function detailInit is processing second request, but I would like to fetch and update data from wxisting data source.

Question is:

How can I display and update (on dataset) related data for selected row from existing data source please?

Function which is initialized click on row expand arrow:

function detailInit(e) {
      alert("TEST");
      $("<div/>").appendTo(e.detailCell).kendoGrid({
        dataSource: {
          type: "odata",
          transport: {
            read: "http://demos.telerik.com/kendo-ui/service/Northwind.svc/Orders"
          },
          serverPaging: true,
          serverSorting: true,
          serverFiltering: true,
          pageSize: 10,
          filter: { field: "EmployeeID", operator: "eq", value: e.data.EmployeeID }
        },
        scrollable: false,
        sortable: true,
        pageable: true,
        columns: [
          { field: "OrderID", width: "70px" },
          { field: "ShipCountry", title:"Ship Country", width: "110px" },
          { field: "ShipAddress", title:"Ship Address" },
          { field: "ShipName", title: "Ship Name", width: "300px" }
        ]
      });
    };

Many Thanks for any help.

1
any solution for this problem?user2439903

1 Answers

0
votes

Why dont you try to take datasource from master datasoruce which created before. You can write

function detailInit(e) {
      alert("TEST");
      $("<div/>").appendTo(e.detailCell).kendoGrid({
         // you should gather masterDataSource here or get from function parameter
         dataSource: {
             data: masterDataSourceName,
             pageSize: 10,
             schema: {
                 model: {
                     fields: {
                        field: "EmployeeID"
                     }
                 }
             }
        },
        scrollable: false,
        sortable: true,
        pageable: true,
        columns: [
          { field: "OrderID", width: "70px" },
          { field: "ShipCountry", title:"Ship Country", width: "110px" },
          { field: "ShipAddress", title:"Ship Address" },
          { field: "ShipName", title: "Ship Name", width: "300px" }
        ]
      });
    };

like this. If you dont have any masterDataSource, you should gather it from your database.