Skip to content

[add] a note on using root id for treegrid/tree in a sub-row#59

Merged
mafanya23 merged 3 commits intomasterfrom
complete-grid-subrow-guides-4850
Mar 23, 2026
Merged

[add] a note on using root id for treegrid/tree in a sub-row#59
mafanya23 merged 3 commits intomasterfrom
complete-grid-subrow-guides-4850

Conversation

@mafanya23
Copy link
Copy Markdown
Contributor

No description provided.

@mafanya23 mafanya23 requested a review from Sorokin-Oleg March 24, 2025 12:18
For example:

~~~jsx {8,16}
grid = new dhx.Grid("grid_container", {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const grid = new dhx.Grid("grid_container", {
    columns: [
        // columns config
    ],
    data: dataset,
    subRow: (row) => (
		new dhx.Grid(null, {
            rootParent: "root", // Add the root id
            columns: [
                { id: "country", header: [{ text: "Country" }] },
                { id: "order_quantity", header: [{ text: "Orders" }], type: "number" },
                { id: "average_check", header: [{ text: "Avg check" }], type: "number" },
            ],
            data: row.data,
            autoWidth: true,
            type: "tree",
        })
	),
});

For example:

~~~jsx {8,16}
grid = new dhx.Grid("grid_container", {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const grid = new dhx.Grid("grid_container", {
    columns: [
        // columns config
    ],
    data: dataset,
    subRow: (row) => (
		new dhx.Grid(null, {
            rootParent: "root", // Add the root id
            columns: [
                { id: "country", header: [{ text: "Country" }] },
                { id: "order_quantity", header: [{ text: "Orders" }], type: "number" },
                { id: "average_check", header: [{ text: "Avg check" }], type: "number" },
            ],
            data: row.data,
            autoWidth: true,
            type: "tree",
        })
	),
});

@mafanya23 mafanya23 merged commit 25ad596 into master Mar 23, 2026
@mafanya23 mafanya23 deleted the complete-grid-subrow-guides-4850 branch March 23, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants