Kendo UI Grid Hierarchy


Ivan Crojach Karačić

What I have is the following DTO passed from the service

class ServiceDto
{
     public string Name { get; set; }
     public string Complete { get; set; }
     public string Incomplete{ get; set; }
     public List<ServiceDto> Detail{ get; set; }
}

Essentially, I have a team with users and the data returned by the service looks like this

 Team 1               3          5
     John Doe         1          3
     Mike Low         2          2

 Team 2               3          3
     Bob Smith        1          2
     Alice Smith      2          1

I have implemented the first part of the equation:

 $(document).ready(function () {
    var element = $("#grid").kendoGrid({
        dataSource: {
            type: "json",
            transport: {
                read: "../home/service"
            }                
        }
        detailInit: detailInit,
        dataBound: function () {
            this.expandRow(this.tbody.find("tr.k-master-row").first());
        },
        columns: [
            { field: "Name", title: "Team Name"},
            { field: "Complete"},
            { field: "Incomplete"}
        ]
    });
});

But I'm not sure how to pass the details of each result to the detailInitinitialization function, which looks like this:

function detailInit(e) {
    $("<div/>").appendTo(e.detailCell).kendoGrid({
        dataSource: {
            type: "json",
            transport: {
                read: ???
            },
        },            
        columns: [
            { field: "Name", title: "User Name" },
            { field: "Complete", title: "Completed task" },
            { field: "Incomplete", title: "Incomplete tasks" }
        ]
    });
}

What do I need to do to pass data from parent?

onabai

detailInitFunctionally, you can get masterdata in e.data.

BTW: Have you considered using KendoUI grid aggregation? View demo here

Related


Kendo UI Grid Hierarchy

Ivan Crojach Karačić What I have is the following DTO passed from the service class ServiceDto { public string Name { get; set; } public string Complete { get; set; } public string Incomplete{ get; set; } public List<ServiceDto> Detail{ get

Kendo UI Grid Hierarchy

Ivan Crojach Karačić What I have is the following DTO passed from the service class ServiceDto { public string Name { get; set; } public string Complete { get; set; } public string Incomplete{ get; set; } public List<ServiceDto> Detail{ get

Format the Kendo UI grid as a hierarchy

Peaceful Thought I want to create a grid through kendo ui as shown below. When loading data, if the level is zero, the padding of the field name is 1, bold, if the level is 2: the font size is smaller, the padding is 10. // Kendo ui grid @(Html.Kendo().Grid<Mo

Change width of Kendo UI grid hierarchy?

ios I have a 13 column grid with a 3 column hierarchy. The problem is that the hierarchy grid takes an average of 13 columns of space to display 3 columns. Is there a way to set the width of the hierarchy grid? Zhang Solomon I think this is the answer you are

Change width of Kendo UI grid hierarchy?

ios I have a 13 column grid with a 3 column hierarchy. The problem is that the hierarchy grid takes an average of 13 columns of space to display 3 columns. Is there a way to set the width of the hierarchy grid? Zhang Solomon I think this is the answer you are

Change width of Kendo UI grid hierarchy?

ios I have a 13 column grid with a 3 column hierarchy. The problem is that the hierarchy grid takes an average of 13 columns of space to display 3 columns. Is there a way to set the width of the hierarchy grid? Zhang Solomon I think this is the answer you are

Kendo UI grid hierarchy invalid template

Aaron Salazar I'm using Kendo Grid and I'm trying to implement a hierarchy like in the example on the demo section of their website . Everything works except .Name("WorkOrderGrid_#=Event.EventReliabilityKey#")row . If I just give it a regular string .Name("Wor

Kendo UI grid hierarchy invalid template

Aaron Salazar I'm using Kendo Grid and I'm trying to implement a hierarchy like in the example on the demo section of their website . Everything works except .Name("WorkOrderGrid_#=Event.EventReliabilityKey#")row . If I just give it a regular string .Name("Wor

Change width of Kendo UI grid hierarchy?

ios I have a 13 column grid with a 3 column hierarchy. The problem is that the hierarchy grid takes an average of 13 columns of space to display 3 columns. Is there a way to set the width of the hierarchy grid? Zhang Solomon I think this is the answer you are

Change width of Kendo UI grid hierarchy?

ios I have a 13 column grid with a 3 column hierarchy. The problem is that the hierarchy grid takes an average of 13 columns of space to display 3 columns. Is there a way to set the width of the hierarchy grid? Zhang Solomon I think this is the answer you are

Kendo UI Grid multi-level hierarchy (n levels of hierarchy)

whip dancer I'm using the Kendo UI grid and the parent and child records are currently displayed correctly. However, it turns out that I will actually need to show n levels, not strictly parent and child. Not every record will have children, but some records w

Kendo UI Grid multi-level hierarchy (n levels of hierarchy)

whip dancer I'm using the Kendo UI grid and the parent and child records are currently displayed correctly. However, it turns out that I will actually need to show n levels, not strictly parent and child. Not every record will have children, but some records w

Kendo UI Grid multi-level hierarchy (n-level hierarchy)

whip dancer I'm using the Kendo UI grid and the parent and child records are currently displayed correctly. However, it turns out that I will actually need to display n levels, strictly the parent. Not every record will have children, but some records will hav

Kendo UI grid update

username I'm using a Kendo UI grid with a service that requires a POST request to update the row as a JSON string instead of a URL encoded form. My grid datasource configuration looks like this: dataSource: new kendo.data.DataSource({ transport: {

Kendo UI grid update

username I'm using a Kendo UI grid with a service that requires a POST request to update the row as a JSON string instead of a URL encoded form. My grid datasource configuration looks like this: dataSource: new kendo.data.DataSource({ transport: {

Kendo UI grid update

username I'm using a Kendo UI grid with a service that requires a POST request to update the row as a JSON string instead of a URL encoded form. My grid datasource configuration looks like this: dataSource: new kendo.data.DataSource({ transport: {

Kendo UI - Tooltips in Grid

no time I am trying to create a tooltip for my grid like this: $("#grid").kendoTooltip({ autoHide: true, showOn: "mouseenter", width:125, height:125, position: "right", filter: ".k-grid-content a.hasTooltip", content: kendo.template

UI unresponsive to Kendo grid

Charvari I've been having issues with kendo grids for the following situations. I have a kendo grid with 18 columns. The user can select multiple rows. The number of rows is mostly over 10000. To get the selected row, I am using grid.select(). To extract conte

Kendo UI grid update

username I'm using a Kendo UI grid with a service that requires a POST request to update the row as a JSON string instead of a URL encoded form. My grid datasource configuration looks like this: dataSource: new kendo.data.DataSource({ transport: {

Kendo UI - Tooltips in Grid

no time I am trying to create a tooltip for my grid like this: $("#grid").kendoTooltip({ autoHide: true, showOn: "mouseenter", width:125, height:125, position: "right", filter: ".k-grid-content a.hasTooltip", content: kendo.template

UI unresponsive to Kendo grid

Charvari I've been having issues with kendo grids for the following situations. I have a kendo grid with 18 columns. The user can select multiple rows. The number of rows is mostly over 10000. To get the selected row, I am using grid.select(). To extract conte

Date format not working with kendo hierarchy grid

username I am using: columns.Bound(j => j.sDate).ClientTemplate("#= kendo.format('{0:dd-MMM-yyyy}', kendo.parseDate(sDate)) #").Title("sDate"); But due to the following error, Error: 0x800a139e - JavaScript Runtime Error: Invalid template. Any help? 克鲁什纳坎 特 (

Get column value in subgrid in kendo grid hierarchy

Sean I have a Kendo grid hierarchy and would like to know how to get the value of a column in a subgrid so that I can pass that value to a function in the controller. The data in the parent grid is pulled from a database table with quote entries, and the child

Date format not working with kendo hierarchy grid

username I am using: columns.Bound(j => j.sDate).ClientTemplate("#= kendo.format('{0:dd-MMM-yyyy}', kendo.parseDate(sDate)) #").Title("sDate"); But due to the following error, Error: 0x800a139e - JavaScript Runtime Error: Invalid template. Any help? 克鲁什纳坎 特 (

Get column value in subgrid in kendo grid hierarchy

Sean I have a Kendo grid hierarchy and would like to know how to get the value of a column in a subgrid so I can pass that value to a function in the controller. The data in the parent grid is pulled from a database table with quote entries, and the child grid

Kendo ui grid (if other conditions)

pilot What's wrong with my code? I have to check in the kendo UI grid if there is "OrderType 20" in the column. If so, I need to apply the css condition that includes the background, but it doesn't work, can anyone help me? thanks template: '# if (OrderType ==

Kendo UI grid binds twice

Trevor Goode Inherited a Kendo app I'm trying to fix and really stuck here. I have a search page bound to a datasource twice and can't figure it out. Here is the grid code: @(Html.Kendo().Grid<Flex.Models.AddEntryEditModel>() .Name("EventGrid") .Column