Skip to content

Infragistics Community Forum / Web / Ignite UI for Angular / In tree grid, expansion indicator issue and children rows

In tree grid, expansion indicator issue and children rows

New Discussion
Shobhana Suara
Shobhana Suara asked on Feb 1, 2022 4:45 PM

Hi,

I'm using a igx-tree-grid with the load on demand for sub grids as stated in the demo:

https://www.infragistics.com/products/ignite-ui-angular/angular/components/treegrid/load_on_demand.html

Scenario: When i Search for both parentID and children IDs.On the search, the parent row loads perfectly with arrow expand indicator. On click of arrow indicator, children rows are loaded properly. 

Issue: When i search for parent as well as child ids, Igx Tree Grid loads with parent rows, child rows and arrow indicator as result. When i click on arrow indicator, sub-grid data (children rows ) are displayed. when i click on expansion indicator for parent row, child rows show. but when i click on the expansion indicator for child row, the next parent row that has child row data does not show its child rows.

To resolve the issue:  I want to load the child rows for each parent row irrespective of if the parent row has data of parent and child ids.

Please help me with this.

This is a bug in igx tree grid load on demand. As we are using this feature, we need a quick work around or fix. Reply ASAP.

Sign In to post a reply

Replies

  • 0
    Viktor Kombov
    Viktor Kombov answered on Dec 31, 2021 11:55 AM

    Hello Shobhana,

    Thank you for posting in our community.

    In order to ensure that your issue is addressed correctly, I will need some additional information regarding your scenario. Can you please elaborate on what kind of search feature you are using? If you are using the Angular Tree Grid Searching through virtualized content, could you please provide me with more details about the configuration that you have made? For example, are you searching for records that are not loaded yet or only for that are already rendered? If your use case is to search records that are not loaded yet, I will need to provide me with code example for the implementation of that searching or with an isolated sample, which I can debug on my side.

    This information is going to be highly appreciated and will help me in my further investigation.

    Looking forward to hearing from you.

    Regards,
    Viktor Kombov
    Entry Level Software Developer
    Infragistics, Inc.

    • 0
      Shobhana Suara
      Shobhana Suara answered on Jan 4, 2022 2:39 PM

      Hi Viktor,

      Please find the attached sample: https://stackblitz.com/edit/angular-igx-load-on-demand-qd9feu?file=src%2Fapp%2Ftree-grid%2Ftree-grid-load-on-demand-sample%2Ftree-grid-load-on-demand-sample.component.html

      Click on Get Data to get grid data.

      Issue: Casey Houston has children records i.e. Gilberto Todd that has 3 children. Now if i click on the expansion indicator of Gilberto Todd of child Gilberto than expansion indicator for another Gilberto is missing. 

      Please help to resolve the issue.

      Thanks.

    • 0
      Shobhana Suara
      Shobhana Suara answered on Jan 5, 2022 2:06 PM

      Please reply ASAP!!

      • 0
        Viktor Kombov
        Viktor Kombov answered on Jan 5, 2022 2:54 PM

        Hello Shobhana,

        I have noticed that in the sample, you have sent me, the records with Name "Gilberto Todd" have the same IDs (Primary Keys). Please keep in mind that the features of the Tree Grid will work as expected only when all records have unique keys. In this sample I am demonstrating how the Tree Grid Load On Demand feature is working properly when all records have unique keys. Can you please test it on your side and let me know if the issue in your project is caused by records that are not with unique Primary Keys?

        Looking forward to hearing from you.

        Regards,
        Viktor Kombov
        Entry Level Software Developer
        Infragistics, Inc.

      • 0
        Shobhana Suara
        Shobhana Suara answered on Jan 20, 2022 3:41 PM

        Hi Viktor,

        On Click of expansion indicator, we call getData() method does it take  primary key by logic?

      • 0
        Shobhana Suara
        Shobhana Suara answered on Jan 24, 2022 6:20 AM

        Helli Viktor,

        Can u reply to my query?

      • 0
        Viktor Kombov
        Viktor Kombov answered on Jan 24, 2022 11:34 AM

        Hello Shobhana,

        Thank you for your patience while I was looking into this matter for you.

        The Tree Grid will be not rendered as expected when the primary keys of the records are not not unique. As mentioned in Angular Tree Grid Overview and Configuration topic in our official documentation, if Primary and Foreign Keys are used, the primary key will be the unique identificator of every record, which means that the primary keys of the recrods must be unique.

        In order to be able to assist you further I will need some additional information regarding your scenario. Could you please elaborate on for what pupose you need to have two different records with the same primary key?

        Looking forward to hearing from you.

        Regards,
        Viktor Kombov
        Entry Level Software Developer
        Infragistics, Inc.

      • 0
        Shobhana Suara
        Shobhana Suara answered on Jan 27, 2022 10:51 AM

        Hello Viktor,

        I have a query where i am using igx tree grid and the parent id has 3 children and one of the children has 3 sub-children ids. Now the sub-child has to access the parent id. Is there a way to do so?

      • 0
        Viktor Kombov
        Viktor Kombov answered on Feb 1, 2022 4:45 PM

        Hello Shobhana,

        At this point we do not provide an out of the box option for getting the root node of a certian row. What I can suggest is creating a recrusive function on application level and using the parent property of IgxTreeGridRow to get the root node of the row:

          const rootRow = this._getRootRow(currRow);
        
          private _getRootRow(row: RowType): RowType {
            if (row.parent) {
              row = this._getRootRow(row.parent);
            }
            return row;
          }

        I created a small sample illustrating my suggestion, which you can find here. Please test it on your side and let me know whether you find it helpful.

        Regards,
        Viktor Kombov
        Entry Level Software Developer
        Infragistics, Inc.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Shobhana Suara
Favorites
0
Replies
9
Created On
Feb 01, 2022
Last Post
4 years, 8 months ago

Suggested Discussions

Created by

Created on

Feb 1, 2022 4:45 PM

Last activity on

Feb 1, 2022 4:45 PM