TortugaGonca
TortugaGonca

Reputation: 31

Nested TreeGrid ExtJs

I need to know if's possible to create a nested treegrid, where each level contains its own set of columns. Something like if I create a grid wich display this 2 classes:

public class Class
{
    public int Id { get; set; }
    public string ClassName { get; set; }
    public string Teacher { get; set; }
}

public class Students
{
    public int Id { get; set; }
    public string StudentName { get; set; }
    public DateTime Birthday { get; set; }
    public int IdClass { get; set; }
}

That when i display the grid there's a node of Class that show the class informations and when it expand, show the students informations

Upvotes: 0

Views: 104

Answers (1)

V G
V G

Reputation: 19002

Yes, it is kind of possible (the columns will be the same for both types). You have two solutions:

  1. map all .net properties from both classes to a single Model in ExtJs and then render them in ExtJS (eventually showing data from both entities in the same columns: you decide how to combine data).

  2. Map all the relevant data from .net to a single field in ExtJS and render a single column.

Also you need a scheme to make all your nodes distinct (eg. the class with ID 1 in .net has the ID c1 in ExtJS and Student with ID1 in .net has the ID s1 in ExtJS). Also it should be clear that a single URl will be provide both the list of classes and the students for a class.

Upvotes: 1

Related Questions