debabratapatra / angular-tree-grid

Angular 10 Tree Grid
https://curiouslinks.com/pages/angular-tree-grid/demo
MIT License
31 stars 17 forks source link

Unable to use HTML in renderer method #29

Closed rrajesh011 closed 4 years ago

rrajesh011 commented 4 years ago

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.

debabratapatra commented 4 years ago

@rrajesh011 I pushed a fix. Thanks

rrajesh011 commented 4 years ago

@debabratapatra how can i get row_id.

this.angularGrid.collapseRow(); this function needs row_id. how can i get that param.

debabratapatra commented 4 years ago

It is the id of the row that you set up in configs. You know which row you want collapse dynamically.

rrajesh011 commented 4 years ago

When passing id_field to this.angularGrid.collapseRow(); function im getting row_index -1 always. and getting error ERROR TypeError: Cannot read property 'pathx' of undefined at AngularTreeGridService.collapseRow (angular-tree-grid.js:170) at AngularTreeGridComponent.collapseRow (angular-tree-grid.js:949) at AttendanceComponent.onExpand (attendance.component.ts:149) at Object.eval [as handleEvent] (AttendanceComponent.html:7) at handleEvent (core.js:43993) at callWithDebugContext (core.js:45632) at Object.debugHandleEvent [as handleEvent] (core.js:45247) at dispatchEvent (core.js:29804) at core.js:31837 at SafeSubscriber.schedulerFn [as _next] (core.js:35379)

rrajesh011 commented 4 years ago

Ok i got it, row_id is string and im passing int value.