Skip to content

Specifying initial selection by node ID #15

@ajirnyiqrm

Description

@ajirnyiqrm

Hi -- first, thanks for the great package!

One question: currently, the selected= argument in treecheckInput() allows to specify the initial selection by value. It works well when the leaves all have unique values, but when they do not, it would be nice to have another way to specify which nodes we want selected. For example, something like c("0.3.1.0", "0.3.1.1") (assuming no conflict) could work.

Looking briefly at the code, it might be that the functionality is already there: e.g. lines 70-72 in treeview.js have

        if (selected.length < 1) {
          selected = tree.findNodes("^" + data.selected[i] + "$", "id");
        }

But I'm not sure how to use it or what the id parameter is -- perhaps adding the same for nodeId (assuming value search and id lookups have both failed) might work?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions