Git Product home page Git Product logo

angular-tree-grid's Introduction

Angular Tree Component

Angular Tree Grid to show hierarchical data. Basically if data has Parent-Child relationship. It also supports sub-grid/nested-grid. If data needs to be grouped by fields then check out this ngtreegrid Package. If header needs to be fixed/freezed and body needs to be scrollable then check out this Fix Header Grid Package.

Demo

Click here for demo. This readme is the documentation. Visit my Website to know other packages.

Loading

Donate ♥️

Please consider a donation if it is useful to you.

Version

Choose the correct version for your application.

Angular angular-tree-grid
<= 8 2.8.76
>= 9 and <= 12 5.0.2
>= 12 7.0.0

Installation

    npm i angular-tree-grid

Usage

Import

Import AngularTreeGridModule Module in your application module.

import { AngularTreeGridModule } from "angular-tree-grid";

Add it to your imports array.

    @NgModule({
      imports: [
        AngularTreeGridModule
      ]
    })

Data

Data should look like below. Data should have Unique field(id) and Parent field(parent) which is foreign key of the id. Ofcourse these fields are configurable. See below.

  data= [
    { id: 1, name: 'Ashok', age: 60, parent: 0},
    { id: 2, name: 'Sam', age: 40, parent: 1},
    { id: 3, name: 'Sriya', age: 36, parent: 1},
    { id: 4, name: 'Prakash', age: 20, parent: 2},
    { id: 5, name: 'Sneha', age: 21, parent: 3},
    { id: 6, name: 'Pritam', age: 60, parent: 34},
    { id: 7, name: 'Roshan', age: 40, parent: 6},
    { id: 8, name: 'Suraj', age: 36, parent: 6},
    { id: 9, name: 'Swarup', age: 20, parent: 8},
    { id: 10, name: 'Aditya', age: 21, parent: 8},
  ];

Configs

Below are configs that can be set

Grid Configurations

Field Type Default Description
*id_field string n/a It's a mandatory field. It is the primary key.
*parent_id_field string n/a It's a mandatory field. It is the foreign key.
*parent_display_field string n/a It's a mandatory field. It is the display field of the row that will be expanded.
data_loading_text string 'Loading...' Loading place holder. This will be displayed when data is empty.
filter boolean false It enables filter toolbar. Filter is customizable at column level.
multi_select boolean false It enables checkbox selection.
rtl_direction boolean false It is for right to left drawing.
cascade_selection boolean false It enables selection of children on selection of Parent and viceversa.
pagination boolean false It enables Pagination.
per_page number 10 Number of rows per page.
row_draggable boolean false It enables dragging and dropping of a row over another. See Example for more information.
show_summary_row boolean false It enables summary or footer row. Use summary_renderer at the column level
load_children_on_expand boolean false It enables dynamic children loading. It means children will be loaded on row-expand. See Example for more information.
subgrid boolean false It enables subgrid feature. parent_id_field is not mandatory for subgrid. Add feature is disabled when it is true. See this Example for more information
subgrid_config Object n/a Configs for subgrid. See below table for this.
show_parent_on_edit boolean true Show Parent column On Edit. It is true by default.
row_class_function Function n/a Callback function for row class. A custom class can be returned which will be added to the row.
row_edit_function Function n/a Callback function for edit feature. Based on the return type(Boolean) of this function, edit can be enabled/disabled for a specific row. See Example for more information.
row_delete_function Function n/a Callback function for delete feature. Based on the return type(Boolean) of this function, delete can be enabled/disabled for a specific row. See Example for more information.
actions Object n/a Settings for Action column. See Below
css Object n/a Css class for icons. See Below
columns Array n/a It is an Array. If not provided all keys of the data Array will be used as Column Headers. Please find the description below
actions
Field Type Default Description
add boolean false It enables add feature.
edit boolean false It enables edit feature.
delete boolean false It enables delete feature.
resolve_add boolean false Manually resolve add(after making call to server). It defaults to false. See example for more information.
resolve_edit boolean false Manually resolve edit.
resolve_delete boolean false Manually resolve delete feature.
css
Field Type Default Description
expand_icon string plus Icon for Expand icon. Font Awesome class can be given. See example for more information.
collapse_icon string minus Icon for Collapse icon. Font Awesome class can be given.
add_icon string plus Icon for Add icon. Font Awesome class can be given.
edit_icon string edit Icon for Edit icon. Font Awesome class can be given.
delete_icon string delete Icon for Delete icon. Font Awesome class can be given.
save_icon string save Icon for Save icon. Font Awesome class can be given.
cancel_icon string cancel Icon for Cancel icon. Font Awesome class can be given.
row_selection_class string n/a CSS Class for selected row.
header_class string n/a CSS Class for header.
table_class string n/a CSS Class for Table.
columns
Field Type Default Description
name string n/a key of the column.
header string n/a Header of the column that will be displayed in the table.
width string n/a Width of the column with unit(px/rem).
css_class string n/a Custom css class for the column.
hidden boolean false Show/Hide column.
filter boolean true Enable/Disable filter.
filter_function Function n/a Custom filter function. filter must be enabled for this. See this Example for more information.
case_sensitive_filter boolean false Case Sensitive/Insensitive Filter.
editable boolean false To make a specific column editable. By default columns are not editable. edit option needs to be true at grid level.
renderer Function n/a It is a method to render customized value for the column. See this Example.
header_renderer Function n/a It is a method to customize column header.
type string '' Set to 'custom' to have custom component for the column. Otherwise leave blank.
component Object n/a Custom View Component. Mandatory if type is custom.See this Example.
editor Object n/a Custom Editor Component. If given custom editor component will be used instead of default editor. See this Example.
on_component_init Function n/a Callback function for the column on component init.
summary_renderer Function n/a Renderer for summary. See this Example for more information.
sortable boolean false Sort Column. Only available for subgrid feature.
subgrid_config
Field Type Default Description
*id_field string n/a It’s a mandatory field. It is the primary key of child data.
data_loading_text string 'Loading...' Loading place holder. This will be displayed when data is getting loaded.
show_summary_row boolean false To show summary row. It defaults to false. Use summary_renderer at the column level.
columns Array n/a See above columns table.

Example

  configs: any = {
    id_field: 'id',
    parent_id_field: 'parent',
    columns: [
      {
        name: 'name',
        header: 'Name',
      },
      {
        name: 'age',
        header: 'Age',
        renderer: function(value) {
          return value + ' years';
        }
      }
    ]
  };

Events

Event Arguments Description
expand row_data: Expanded Row
For Subgrid and Dynamic-Children-Loading:
event Consist of:
  • data: Selected Row
  • resolve: Promise Object
Event fires when parent is expanded. For Subgrid, see this Example. For Dynamic-Children-Loading, see this Example
collapse row_data: Collapsed Row Event fires when parent is collapsed.
cellclick event Consist of:
  • row: Selected Row
  • column: Selected Column
  • event: Selected Column
Event fires when a child cell is clicked.
rowselect event Consist of:
  • data: Selected Row
  • event: Event Object
Event fires when a row is selected.
rowdeselect event Consist of:
  • data: Selected Row
  • event: Event Object
Event fires when a row is deselected.
rowselectall event: Event Object Event fires when select-all checkbox is checked.
rowdeselectall event: Event Object Event fires when select-all checkbox is unchecked.
rowsave event Consist of:
  • data: Selected Row
  • event: Event Object
Event fires when a row is saved.
rowdelete event Consist of:
  • data: Selected Row
  • event: Event Object
Event fires when a row is deleted.
rowadd event Consist of:
  • data: Selected Row
  • event: Event Object
Event fires when a row is added.

HTML

Add below node to your html.

  <db-angular-tree-grid [data]="data" [configs]="configs"></db-angular-tree-grid>

Functions

AngularTreeGridComponent has some very useful functions. Below is an example how to call.

    @Component({
      selector: 'app-basic-tree-grid',
      template: `
        <button (click)="collapseAll()">Collapse All</button><button (click)="expandAll()">Expand All</button>
        <p></p>
        <db-angular-tree-grid #angularGrid [data]="data" [configs]="configs"></db-angular-tree-grid>
      `
    })
    export class BasicTreeGridComponent {
      @ViewChild('angularGrid') angularGrid: AngularTreeGridComponent;

      expandAll() {
        this.angularGrid.expandAll();
      }
      collapseAll() {
        this.angularGrid.collapseAll();
      }
    }
Function Arguments Description
expandAll None Expands all rows
collapseAll None Collapses all rows
selectAll None Selects all rows
deSelectAll None DeSelects all rows
expandRow
  • id: Row id(Primary Key)
  • suppress_event: Suppress expand event. It defaults to false.
Expands a specific row. see this Example.
collapseRow
  • id: Row id(Primary Key)
  • suppress_event: Suppress expand event. It defaults to false.
Collapses a specific row. see this Example.
disableRowSelection id: Row id(Primary Key) Disables Row Selection for the specific Row id.
enableRowSelection id: Row id(Primary Key) Enables Row Selection for the specific Row id.
disableRowExpand id: Row id(Primary Key) Disables Row Expand for the specific Row id.
enableRowExpand id: Row id(Primary Key) Enables Row Expand for the specific Row id.
export name: String Exports table content to csv.

Can I hire you guys?

Yes. Please contact us at [email protected] for any professional support. We will be happy to work with you!

License

This project is licensed under the MIT license.

angular-tree-grid's People

Contributors

debabratapatra avatar seramah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

angular-tree-grid's Issues

Tree Structure fails for the given data

When I use this data it is breaking the tree structure
data: any =
[
{
"id": "1",
"name": "Architecture Phase II",
"parent": ""
},
{
"id": "2",
"name": "Architecture Practice Edited",
"parent": "1"
},
{
"id": "8c7fda5e-2492-45ff-b5b5-2c8b34928df3",
"name": "Desijnjngn",
"parent": "2"
},
{
"id": "a6c1-4bdf-9709-795bf3914dc7",
"name": "Desigdn the house",
"parent": "8c7fda5e-2492-45ff-b5b5-2c8b34928df3"
},

{
"id": "mAcfc08c81-491c-45ad-ab32-b4e3cd89f957",
"name": "Moving In",
"parent": ""
},
{
"id": "mA08b9d248-36ff-40de-8254-97518ba1b91a",
"name": "Decorating",
"parent": "mAcfc08c81-491c-45ad-ab32-b4e3cd89f957"
},
{
"id": "mA9aff9de5-18cd-4fe8-929a-f2ff7c6bb810",
"name": "Painting",
"parent": "mA08b9d248-36ff-40de-8254-97518ba1b91a"
},

{
"id": "mAa0100243-4a79-436c-9a62-47c8c8caa23c",
"name": "Architecture Practice Edite",
"parent": "mAcfc08c81-491c-45ad-ab32-b4e3cd89f957"
},
{
"id": "8c7fda5e-2492-45ff-b5b5-2c8b34928df3",
"name": "Design",
"parent": "mAa0100243-4a79-436c-9a62-47c8c8caa23c"
}

];

What can be the issue? When I changed the IDs it is working fine.
Getting below error:
parent_pathx.join is not a function.

Do we have any limitation on ID length or characters?

expandRow function doesnt behave the same as (expand) event emitter

When clicked on expand icon from the view -> it triggers event emitter (expand) and it waits for the dynamic children to load and there is a loading symbol in expand icon.

When the expandRow function is called from ts -> it triggers event emitter (expand) but it doesn't wait for the dynamic children to load and there is no loading symbol shown in expand icon.

Annotation 2019-09-27 181638

Doesn't work on angular 12

Made an example using this library on Angular 12 project.
Got this error:
image

image
I set up a new project, and got the same error. Copied the code from the basic example.

Dynamically Adding Childrens/Nodes do not update the tree

Hi Deb.

I tried to have a api call on expand event and then tried to add response to the tree dataSource.

The dataSource shows changes but DOM do not update.

DOM only updates when I reload it using *ngIf.

Thank you for wonderful plugin and Helping us out in a very very short time, for the issue

Issue when I build my project

Hi,
I have theses issues when I run npm build for my project.

ERROR in node_modules/angular-tree-grid/angular-tree-grid.d.ts.ɵc.html(34,11): : Element implicitly has an 'any' type because type 'Object' has no index signature.
node_modules/angular-tree-grid/angular-tree-grid.d.ts.ɵc.html(34,11): : Type 'undefined' cannot be used as an index type.
node_modules/angular-tree-grid/angular-tree-grid.d.ts.ɵc.html(34,11): : Element implicitly has an 'any' type because type 'Object' has no index signature.
node_modules/angular-tree-grid/angular-tree-grid.d.ts.ɵc.html(34,11): : Type 'undefined' cannot be used as an index type.
node_modules/angular-tree-grid/angular-tree-grid.d.ts.ɵg.html(1,7): : Type 'undefined' cannot be used as an index type.
node_modules/angular-tree-grid/angular-tree-grid.d.ts.ɵg.html(1,7): : Type 'undefined' cannot be used as an index type.
node_modules/angular-tree-grid/angular-tree-grid.d.ts.ɵi.html(19,3): : Type 'undefined' cannot be used as an index type.
node_modules/angular-tree-grid/angular-tree-grid.d.ts.ɵk.html(2,5): : Type 'undefined' cannot be used as an index type.
node_modules/angular-tree-grid/angular-tree-grid.d.ts.ɵk.html(2,5): : Type 'undefined' cannot be used as an index type.
node_modules/angular-tree-grid/angular-tree-grid.d.ts.ɵm.html(1,15): : Element implicitly has an 'any' type because type 'Object' has no index signature.
node_modules/angular-tree-grid/angular-tree-grid.d.ts.ɵn.html(2,7): : Object is possibly 'undefined'.

Unable to use HTML in renderer method

Hi @debabratapatra im using this lib and everything is quit good. few thing i have noticed that I cant pass html in renderer method.
e.g. if i return <span class=red>Some text</span> it print span tag also.

here is my column object
{ name: 'mar', header: 'Mar', renderer(value) { return value || '<span>-</span>'; } }

image

i want to show red text if value is less than 8.

Also used CustomComponent property but unable to pass value from one component to another component.

Kindly suggest if there is any other way.

Not able to customize Grid header using 'header_class'

I am trying to increase the font size of the header text with the following class in styles.css
it doesnt seem to consider the class

.header-class{
  font-size: 44px;
}

And my grid config looks like this:

configs: any = {
    id_field: 'id',
    parent_id_field: 'parent',
    parent_display_field: 'name',
    css: { // Optional
      expand_class: 'fa fa-plus-square-o ',
      collapse_class: 'fa fa-minus-square-o',
      header_class: 'header-class'
    },

....

Force refresh children datas without loosing expansion states

Hi there !

We're implementing a version of your component for a couple of months now and it was working pretty great until we faced a specific need.
We want to refresh our datas over time, meaning we change a year selection and expect to refresh live the content of the tree grid while maintaining the expansion state.

What we saw is that unfortunately to reload the content, we have to do a collapseAll and reopen manually to force fetch the new datas, which is not really user-friendly.

Do you have any other solutions ?

1 - We tried to re-generate the onExpand event manually -> doesn't work
2 - Refresh all the open childrens based on this.angularGrid.expand_tracker, browse them and force expand() -> doesn't work

Parent Dropdown is missing on Edit

I am Using the Angular tree grid in my project i facing an issues, when i click on edit icon am unable to load the drop down on Add Icon its working fine Please below screenshot
image

I tried the Debug and fond that the below
image.png
image

Surprisingly When i add new node then and click edit now the edit dropdown is showing fine
My Package.json file
image

My Configuration
configs: any = { id_field: 'syllabusId', parent_id_field: 'parentSyllabusFK', parent_display_field: 'topic', filter: true, actions: { add: true, edit: true, delete: true, edit_parent: true, resolve_add: true, resolve_delete: true, resolve_edit: true }, css: { // Optional expand_class: 'fa fa-caret-right', collapse_class: 'fa fa-caret-down', add_class: 'fa fa-plus', edit_class: 'fa fa-pencil', delete_class: 'fa fa-trash', save_class: 'fa fa-save', cancel_class: 'fa fa-remove', }, columns: [ { name: 'topic', header: 'Topic Name', editable: true, sortable: true }, { name: 'levelNumber', header: 'Level', editable: true, sortable: true, css_class:'alignTest', }, { name: 'desc', header: 'Description', editable: true, sortable: true }, { name: 'lessonsCount', header: 'Lessons', type: 'custom', css_class:'alignTest', component: CustomCellViewComponent }, { name: 'studyMaterialCount', header: 'Study Material', type: 'custom', css_class:'alignTest', component: CustomStudyMaterialComponent }, { name: 'quizCount', header: 'Quizzes', type: 'custom', css_class:'alignTest', component: CustomQuizzesComponent } ], row_edit_function: function (rec: any) { if (rec.parentSyllabusFK === 18) { return false; } else { return true; } }, row_delete_function: function (rec: any) { if (rec.parentSyllabusFK === 18) { return false; } else { return true; } }, row_class_function: function (rec: any) { return 'row-custom'; } };

My Html
<db-angular-tree-grid #angularGrid [data]="data" [configs]="configs" (add)="onAdd($event)" (rowdelete)="onRowDelete($event)" (rowsave)="onRowSave($event)" (rowadd)="onRowAdd($event,data)"> </db-angular-tree-grid>
please Do Needfull

Problem with expandRow in case of Dynamic Children

I'm trying to expand automatically level 0 of my tree. After initial loading, I set data to the tree grid and try to expand the root node with expandRow(root.id). the expandable indicator change to expanded, but child data are not loaded. I've tried the same thing into your demo at that link https://debabratapatra.github.io/pages/angular-tree-grid/demo/#/dynamic_children
if you click on expandAll, you will have the same behaviour.

image

Looking at the image, I found that if we are in the root level, pathx have only one element, so the first If inside the for always avoid the following code
I've tried on my local .js file to fix this with let expanded_count = 0; , and works, but I'm not sure if can cause other problems.

Need to have a button as column header, Please guide how to implement

Hi Team,
Need to have a button as column header, Please guide how to implement. we already built button with expand, collapse functionality, but not able to make it as column header. Request you to please suggest on this. How to make button as column header.
Thanks,
Sailaja.

Misaligned nested items of the same level

Hi, first of all, congrats on that great angular component.

I have an issue with misaligned nested items of the same level, as shown:

image
3 grandson´s but only who own nested items stay aligned.

image
2 great-grandson´s but only who own nested items stay aligned.

When the nested item has a nested item too, the brother item without nested(item) stay misaligned.

I tried to change that part to make some alignment but doesn't work completely
<div [ngStyle]=\"{'padding-left': row_data.leaf ? row_data.levelx * 20 + 'px' : row_data.levelx * 10 + 'px'}\">

Thanks!

How can we override the default css for custom component?

Hi,
I have a custom component which shows the profile picture of a user along with that I added expansion class for that component.
Issue:
When am loading the data some alignment is missing.Please check the below attached picture.
Screenshot 2020-01-08 at 5 09 17 PM

Can I override the default css and apply new css?Any solution override this problem.

In-line add issue

Hi, I got some problem using the inline add function, when click add, the callback function can be called, but either adding the new added item into the [data]="data" or directly push into this.menuGrid.data.push(menu) (for instance, db-angular-tree-grid #menuGrid), the tree grid will not updated, but got erros below:
TreeBodyComponent.html:93 ERROR TypeError: Cannot read property 'length' of undefined
at Object.eval [as updateDirectives] (TreeBodyComponent.html:100)
at Object.debugUpdateDirectives [as updateDirectives] (core.js:30043)
at checkAndUpdateView (core.js:29439)
at callViewAction (core.js:29680)
at execEmbeddedViewsAction (core.js:29643)
at checkAndUpdateView (core.js:29440)
at callViewAction (core.js:29680)
at execComponentViewsAction (core.js:29622)
at checkAndUpdateView (core.js:29445)
at callViewAction (core.js:29680)

core.js:4002 ERROR TypeError: Cannot read property 'map' of undefined
at SafeSubscriber._next (angular-tree-grid.js:1112)
at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:192)
at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (Subscriber.js:130)
at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (Subscriber.js:76)
at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:53)
at Subject.push../node_modules/rxjs/_esm5/internal/Subject.js.Subject.next (Subject.js:47)
at AngularTreeGridService.push../node_modules/angular-tree-grid/fesm5/angular-tree-grid.js.AngularTreeGridService.updateDisplayDataObservable (angular-tree-grid.js:25)
at Store.push../node_modules/angular-tree-grid/fesm5/angular-tree-grid.js.Store.setDisplayData (angular-tree-grid.js:422)
at Store.push../node_modules/angular-tree-grid/fesm5/angular-tree-grid.js.Store.setProcessedData (angular-tree-grid.js:401)
at Store.push../node_modules/angular-tree-grid/fesm5/angular-tree-grid.js.Store.processData (angular-tree-grid.js:671)

Could you have a look? Thanks

Expand All option event Trigger

I have 1500 rows of data. if i expand all the rows it takes much time to show in grid. i wanna show the loader based on the event. Do we have a solution for this ?

Column wise CSS class definition

@debabratapatra how can i add CSS class to a column in angular tree grid. for example, if numbers fields how can i align to right side?
also, Is it possible to add footer in table. for example, how can i add total value in bottom of table.
thanks in advance.

dynamic expand undesirable/unwanted behaviour.

this is the link for stackblitz.
https://stackblitz.com/edit/angular-bku2pg

issue steps:

  1. expand first row by click expand icon near name ("Bimal")
    it will add property expand(which value is bollean) to our data(which I have used after add click).

  2. now click on add button from age column(first row) it will add(push) new record to our data
    so now in data we have new row with old data with expand property(true or false).
    so I loop thorugh data and where i find expand true I have called expand function.

  3. it expand 2nd row also(which is not expanded before add click).

Screen Recording

I want expand only previosly expanded row.

Sort feature

The documentation mentions sort is enabled only for subgrid.
I see main grid sort as a very essential feature. Any plans to support sort feature ?

Angular material support

First of all I have to mention that the tree grid widget is great.
I have a question though. Does it support material styling out of the box ?
I noticed that the text boxes shown for edit doesnt seem to be of material design .
Also does it support material icons ?

how to rebind the updated data to the angular tree grid.

I am updating the data in some other component and trying to reload the same in angular tree grid.

If I rebuild whole grid array and bind it to the angular tree grid then it is losing the collapse and expand feature. So, if I just update the element and expecting the change in the value then it is not showing in the table. I mean the updated data is not getting updated in the table.

Is there any way where if I can rebind the data again to the angular tree grid

Check and uncheck not propagating to the children and parent.

As excepting that if I check the parent all the children should checked which is general behavior for most of the tree table with check box option. in the same way if all the children unchecked its parent should also get unchecked.

Can that be implemented in future or is it still in development.

Thanks
Srinivas

Column Custom Class

Hi, looking at tree-head.component.html, it seems that column css_class wasn't used?

Thanks!

Conditionally display expand/collapse icon

Hi @debabratapatra
First of thanks for this module it helps a lot to me.

I want to display expand icon when it has child.
I have a property in data object hasChild:true.

When I add loading_children_on_expand to true it display expand and collapse icon on all rows. Any way to add those icon conditionally.

Here is my config

configs: any = { id_field: 'id', parent_id_field: 'parent', parent_display_field: 'name', loading_children_on_expand:true, css: { // Optional expand_class: 'fa fa-caret-right', collapse_class: 'fa fa-caret-down', }, columns: [ { name: 'name', header: 'Name', width: '100px' }, { name: 'age', header: 'Age', renderer: function(value) { return value + ' years'; } }, { name: 'weight', header: 'Weight' }, { name: 'gender', header: 'Gender', renderer: function(value) { return value ? 'Male' : 'Female'; } }, { name: 'phone', header: 'Phone', width: '150px' } ] };

data

data: any[] = [ { id: 1, name: 'Prakash', age: 60, weight: 60, gender: 1, phone: 7930343463,hasChild:false}, { id: 2, name: 'Aditya', age: 40, weight: 90, gender: 1, phone: 7930343463, hasChild:true} ];

Unable to get column data in Custom component

I am using a custom cell component which looks like below:

@Component({
  selector: 'app-cell-component',
  templateUrl: './custom-cell-view.component.html',
  styleUrls: ['./custom-cell-view.component.css']
})
export class CustomCellViewComponent implements OnInit {

  @Input()
  column: any;

  @Input()
  cell_value: string;

  @Input()
  row_data: any;

The cell_value & row_data values can be accessed but When I display the 'column' value it is undefined. What am is missing ?
Update:
In chrome debug mode, I do see the below:

<db-custom-cell-component ng-reflect-column="[object Object]"

Not working in angular 12

Hello, i just discovered this amazing package that can solve a big problem im having right now, i've tried to install it in an Angular 12 project, but just the installation is crashing, with a Peer dependency issue, inspecting the package.json of the project, i've seen that this package uses angular 7, first i tried the solution that the npm it self recomends, is to use "npm i angular-tree-grid --legacy-peer-deps" and apparently worked, then after importing the package in my "app.module.ts" and doing everything to make it work, i tried it and BOOM, nothing rendered... in the Chrome console i inspected the website and there is the HTML tag, but with a width and height of 0, after seeing this i thought maybe i did something wrong with the data or the config, but i dont think so, then i searched about the peer dependency issue, and found this https://stackoverflow.com/a/66620869 that helped me to understand more the issue, and after this i modified the "package-lock.json" package peer dependencies to the same version of my project, but the seem issue happened.

Thanks.

Help

help, I have been trying to change the properties of the grid css_class in the column but I have not been successful, could you guide me to be able to change the style to a column
thanks

Issue with row_class_function

Hello,

In the TreeBodyComponent.html there's a mistake in the line :

[attr.class]="configs.row_class_function(raw_data) + ' ' + (row_data.row_selected ? configs.css.row_selection_class : '')"

raw_data should be row_data

Can you please fix it?

Row expanded by default

Hi! It seems that all rows are collapsed by default on initial load. Is it possible to have specific row(s) expanded by default? Thanks

when i use two different tag in same html page its showing error.

when i use two different table in sample html page. its showing error. both list data getting from server side. html code for your reference:

<db-angular-tree-grid [data]="data" [configs]="configs" >
<db-angular-tree-grid [data]="data1" [configs]="configs_1" id="2">

Cancel icon not work in edit mode

Hi, I'm using the tree grid with angular version 8, unfortunately I don't understand why when I try to modify a row the cancel icon saves instead of canceling. What am I doing wrong?

AngularTreeGrid: Facing issue element are more than 200, to render tree structure

TailorWBSComponent.html:33 ERROR TypeError: parent_pathx.join is not a function
at angular-tree-grid.js:748
at Array.map ()
at Store.push../node_modules/angular-tree-grid/fesm5/angular-tree-grid.js.Store.processData (angular-tree-grid.js:741)
at AngularTreeGridComponent.push../node_modules/angular-tree-grid/fesm5/angular-tree-grid.js.AngularTreeGridComponent.ngOnChanges (angular-tree-grid.js:939)
at checkAndUpdateDirectiveInline (core.js:22095)
at checkAndUpdateNodeInline (core.js:23363)
at checkAndUpdateNode (core.js:23325)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.