Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include igTree from jQuery to Ignite UI for Angular #7475

Closed
pranaysharmadelhi opened this issue Jun 3, 2020 · 10 comments · Fixed by #8945
Closed

Include igTree from jQuery to Ignite UI for Angular #7475

pranaysharmadelhi opened this issue Jun 3, 2020 · 10 comments · Fixed by #8945
Assignees
Labels
program: igniteui project management 🧰 feature-request tree ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.

Comments

@pranaysharmadelhi
Copy link

Is your feature request related to a problem? Please describe.

Include igTree from jQuery to Ignite UI for Angular for easy inclusion

Describe the solution you'd like

Ability to add IgxTreeModule similar to IgxGridModule

Describe alternatives you've considered

Tried including IgTreeComponent, but that causes failures with other Modules

Additional context

@Lipata
Copy link
Member

Lipata commented Jun 3, 2020

@pranaysharmadelhi have you tried our angular wrappers for Ignite UI for jQuery?

@pranaysharmadelhi
Copy link
Author

Ya, they are causing the Grid Modules to fail. They are not compatible.

@Lipata
Copy link
Member

Lipata commented Jun 3, 2020

@pranaysharmadelhi can you attach a sample or link to a StackBlitz demo, where we can investigate the problem you are experiencing?

@github-actions
Copy link

github-actions bot commented Aug 4, 2020

There has been no recent activity and this issue has been marked inactive.

@github-actions github-actions bot added the status: inactive Used to stale issues and pull requests label Aug 4, 2020
@Lipata Lipata removed the status: inactive Used to stale issues and pull requests label Aug 4, 2020
@github-actions
Copy link

github-actions bot commented Oct 4, 2020

There has been no recent activity and this issue has been marked inactive.

@github-actions github-actions bot added the status: inactive Used to stale issues and pull requests label Oct 4, 2020
@radomirchev radomirchev removed the status: inactive Used to stale issues and pull requests label Oct 5, 2020
@github-actions
Copy link

github-actions bot commented Dec 5, 2020

There has been no recent activity and this issue has been marked inactive.

@github-actions github-actions bot added the status: inactive Used to stale issues and pull requests label Dec 5, 2020
@zdrawku zdrawku removed the status: inactive Used to stale issues and pull requests label Jan 4, 2021
@zdrawku zdrawku reopened this Jan 4, 2021
@ViktorSlavov ViktorSlavov self-assigned this Jan 19, 2021
@radomirchev radomirchev added 🛠️ status: in-development Issues and PRs with active development on them and removed 🆕 status: new labels Feb 4, 2021
@ViktorSlavov
Copy link
Contributor

@pranaysharmadelhi , Thanks for bringing this to our attention!

We've started developing an igx-tree component which will cover the functionality of igTree in a native angular control.
You can check the spec and comment here w/ any questions and suggestions.

You can also track the progress of the implementation in this issue.

@ViktorSlavov
Copy link
Contributor

ViktorSlavov commented Feb 8, 2021

IgxTree Implementation

Spec
Samples

  • Basic Implementation (file structure, dev sample)
    • IgxTreeComponent
    • IgxTreeNodeComponent
    • Dev sample
  • Node state implementation
    • Tree API service
    • Tree state methods (expand/collapse/toggle)
    • Tree node input (expanded)
    • Animations (open/close animation as in IgxExpansionPanel)
    • Expand/Collapsed events
  • Selection
    • Selection Modes ('None', 'BiState', 'Cascading')
    • Cascading Selection - Implementation
    • Tree API methods (select/deselect node)
    • Tree node input (selected)
    • Selection events
  • Keyboard Navigation
    • Basic navigation (active item)
    • Selection
    • Toggle
  • Aria Support
    • Aria roles and tab index on tree / tree nodes
    • igxTreeNodeLink directive + roles
  • Styling
    • Tree and Tree Node classes in theming
    • Actual stying
  • Testing
    • Test scenarios in spec
    • Implement unit tests
    • Implement e2e tests
  • Docs
    • README.md
    • docfx page entry
    • igniteui-angular-sample entry
    • igniteui-cli template
  • Drag and drop
    • Basic implementation
    • Events and event args

@ViktorSlavov
Copy link
Contributor

Since we're going w/ a declarative approach, we will have some limitations regarding the tree. There is a known issue in Angular for using @ContentChildren directive together w/ ngTemplateOutlet.
More specifically, this impacts the tree when:

  1. Recursively creating nodes via ng-template is not supported:
<!-- this is not supported and will lead to incorrect behavior -->
<igx-tree>
     <ng-container *ngFor="let node of data">
          <ng-template ngProjectAs="igx-tree-node" *ngTemplateOutlet="recursiveNodeTemplate; context: { $implicit: node }">
          </ng-template>
     </ng-container>
     <ng-template #recursiveNodeTemplate let-node>
          <igx-tree-node [data]="node">
               {{node.label}}
               <ng-container *ngFor="let entry of node.children">
                     <ng-template ngProjectAs="igx-tree-node" *ngTemplateOutlet="recursiveNodeTemplate; context: { $implicit: entry}">
                     </ng-template>
               </ng-container>
          </igx-tree-node>
     </ng-template>
</igx-tree>

Currently, all levels of the hierarchy must be written explicitly.

  1. Creating an anchor (<a>) child w/ our tab stop directive ([igxTreeNodeLink]) via ng-template. As a workaround you need to pass a ref to the parent node (<a [igxTreeNodeLink]="parentRef"></a>):
<igx-tree>
    <igx-tree-node #nodeRef *ngFor="let node of data" [data]="node">
         <!-- template outlet in node content -->
         <ng-template *ngTemplateOutlet="nodeTemplate; context: { $implicit: node, node: nodeRef }">
         </ng-template>
         <igx-tree-node #nodeRef *ngFor="let childNode of node.children" [data]="childNode">
             <!-- template outlet in node content -->
             <ng-template *ngTemplateOutlet="nodeTemplate; context: { $implicit: childNode, node: nodeRef }">
             </ng-template>
             ....
         </igx-tree-node>
    </igx-tree-node>
    <!-- template is defined in the tree body -->
    <ng-template #nodeTemplate let-data let-parent="nodeRef">
         <!-- explicitly pass a reference to the parent node via `[igxTreeNodeLink]="parent"` -->
          <a [igxTreeNodeLink]="parent" [href]="data.href">{{ data.label }}</a>
    </ng-template>
</igx-tree>

The ng-template should also be initialized inside of the igx-tree tag (for DI providers).

@radomirchev radomirchev removed their assignment Apr 9, 2021
@ViktorSlavov ViktorSlavov added ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged. and removed 🛠️ status: in-development Issues and PRs with active development on them labels Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
program: igniteui project management 🧰 feature-request tree ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants