p-tree filter Issue

UI Components for Angular
Post Reply
santu1991
Posts: 2
Joined: 20 Dec 2019, 10:17

05 Jan 2020, 06:15

Not showing child nodes, we have to manually open tree to see the filtered result.

in html file:

Code: Select all

<p-tree [value]="filesTree2" filter="true" selectionMode="single" filterMode="strict"></p-tree>
in component.ts:

Code: Select all

filesTree2: TreeNode[] =
[
    {
        "label": "Documents",
        "key": "Documents",
        "data": "Documents Folder",
        "expandedIcon": "fa fa-folder-open",
        "collapsedIcon": "fa fa-folder",
        "children": [{
                "label": "Work",
                "key": "Work",
                "data": "Work Folder",
                "expandedIcon": "fa fa-folder-open",
                "collapsedIcon": "fa fa-folder",
                "children": [{"label": "Expenses.doc", "key": "Expenses.doc", "icon": "fa fa-file-word-o", "data": "Expenses Document"}, {"label": "Resume.doc", "key": "Resume.doc", "icon": "fa fa-file-word-o", "data": "Resume Document"}]
            },
            {
                "label": "Home",
                "key": "Home",
                "data": "Home Folder",
                "expandedIcon": "fa fa-folder-open",
                "collapsedIcon": "fa fa-folder",
                "children": [{"label": "Invoices.txt", "key": "Invoices.txt", "icon": "fa fa-file-word-o", "data": "Invoices for this month"}]
            }]
    },
    {
        "label": "Pictures",
        "key": "Pictures",
        "data": "Pictures Folder",
        "expandedIcon": "fa fa-folder-open",
        "collapsedIcon": "fa fa-folder",
        "children": [
            {"label": "barcelona.jpg", "key": "barcelona.jpg", "icon": "fa fa-file-image-o", "data": "Barcelona Photo"},
            {"label": "logo.jpg", "key": "logo.jpg", "icon": "fa fa-file-image-o", "data": "PrimeFaces Logo"},
            {"label": "primeui.png", "key": "primeui.png", "icon": "fa fa-file-image-o", "data": "PrimeUI Logo"}]
    },
    {
        "label": "Movies",
        "key": "Movies",
        "data": "Movies Folder",
        "expandedIcon": "fa fa-folder-open",
        "collapsedIcon": "fa fa-folder",
        "children": [{
                "label": "Al Pacino",
                "key": "Al Pacino",
                "data": "Pacino Movies",
                "children": [{"label": "Scarface", "lakeybel": "Scarface", "icon": "fa fa-file-video-o", "data": "Scarface Movie"}, {"label": "Serpico", "key": "Serpico", "icon": "fa fa-file-video-o", "data": "Serpico Movie"}]
            },
            {
                "label": "Robert De Niro",
                "key": "Robert De Niro",
                "data": "De Niro Movies",
                "children": [{"label": "Goodfellas", "key": "Goodfellas", "icon": "fa fa-file-video-o", "data": "Goodfellas Movie"}, {"label": "Untouchables", "key": "Untouchables", "icon": "fa fa-file-video-o", "data": "Untouchables Movie"}]
            }]
    }
];
  • when i tried to search for "Expenses" in search filter tree should open and show the result which is not working .
  • Present Result : Now it displays only Root node which is Documents , user has to manually click and open the node to find the filtered result...example (when you search for "Exp" in filter, result in tree is Documents only)
  • Expected Result : It should display with documents node as expanded ..example (when you search for "Exp" in filter, result in tree should be Documents -> work-> Expenses.doc)
  • Even i tried with Lenient Filter Mode and Strict Filter Mode with that also no result.
  • i am using 7.1.3 prime ng version....please help, Thank you

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 22 guests