Reputation: 31
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
Reputation: 19002
Yes, it is kind of possible (the columns will be the same for both types). You have two solutions:
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).
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