Row parent-childrens (tree)

Row parent-childrens (tree)

AlexAlex Posts: 1Questions: 0Answers: 0
edited May 2009 in General
I saw that discussion:

http://datatables.net/forums/comments.php?DiscussionID=227&page=1#Item_0

about the possiblity that rows can have parent && childrends at multiple level and just want to know if it will be implemented in dataTables. I could be nice to have something like that:

[code]
ASC
COLUMN1 COLUMN2 COLUMN3 COLUMN4
ROW1 1 1 1 1
ROW2 2 2 2 2
ROW2.1 2.1 2.1 2.1 2.1
ROW2.2 2.2 2.2 2.2 2.2
ROW3 3 3 3 3
ROW3.1 3.1 3.1 3.1 3.1
ROW3.2 3.2 3.2 3.2 3.2
ROW3.2.1 3.2.1 3.2.1 3.2.1 3.2.1
ROW4 4 4 4 4
[/code]

Where row can be expended, stay grouped when sorted and sorted by level.
By sorted by level i mean:

ROW1, ROW2, ROW3, ROW4 will be sorted THEN

ROW2.1, ROW2.2 will be sorted THEN

ROW3.1 ROW3.2 will be sorted THEN

(nothing more to sort).

[code]
DESC
COLUMN1 COLUMN2 COLUMN3 COLUMN4
ROW4 4 4 4 4
ROW3 3 3 3 3
ROW3.2 3.2 3.2 3.2 3.2
ROW3.2.1 3.2.1 3.2.1 3.2.1 3.2.1
ROW3.1 3.1 3.1 3.1 3.1
ROW2 2 2 2 2
ROW2.2 2.2 2.2 2.2 2.2
ROW2.1 2.1 2.1 2.1 2.1
ROW1 1 1 1 1
[/code]

So the right question is: Will dataTables support TREE structure?

Replies

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Hi Alex,

    Thanks for your post. DataTables does not have built-in support for this type of arrangement at the moment, nor is it on the road-map, but it is possible to do this through the API, as noted in the conversation you linked to.

    Basically what would be required is use of the fnAddData() and fnDeleteRow() functions, and also use of the hidden columns for searching and sorting.

    If this is something you require for a project and want it implemented, please feel free to get in touch about contract work.

    Regards,
    Allan
This discussion has been closed.