Giter VIP home page Giter VIP logo

Comments (10)

queejie avatar queejie commented on August 20, 2024 1

Reading through the code, maybe wrapping line 61 in treeview.component.ts in a div and using an [innerHTML] attribute there would be the solution?

I changed the compiled javascript to do that, and it worked fine:

<div [innerHTML]="item.text"></div>

That really allows for a lot of new things, including images, icons, audio and video, etc.

from ngx-treeview.

queejie avatar queejie commented on August 20, 2024 1

@vanchisel In the absence of help here I've switched over to using angular2-tree. That module has extensive templating that allows for complex node displays.

from ngx-treeview.

leovo2708 avatar leovo2708 commented on August 20, 2024 1

@vanchisel I added more functions in this component but maybe my demo didn't show up these. I will try to update my demo in next time.

from ngx-treeview.

thomascayne avatar thomascayne commented on August 20, 2024

@queejie This is exactly the feature I've being hoping and searching for, to be able to prepend/append html, images and text to each (item) node in the tree. I was able to extend zTree for JavaScript. For example:

   - Miramar Associates LLC (#185-784-957)
     - Quality Assurance Docket (#45768509) (#457685)
     - Special Education Calendar (#90815201) (#908152)

Parents and children will have different/custom images. The #s above are unique to each item/node.

ztree is pure JavaScript, not written for Angular.

from ngx-treeview.

thomascayne avatar thomascayne commented on August 20, 2024

@queejie Thank you for the heads up. I couldn't get ngx-treeview to work either (something about cannot resolve due to source-map-loader) so I switched over to using zTree with jQuery. Yeah, I know, in Angular. It's working beautifully. I will check out Angular2-tree later. Thanks.

from ngx-treeview.

leovo2708 avatar leovo2708 commented on August 20, 2024

@queejie I really implemented item template. You can check demo here: https://leovo2708.github.io/ngx-treeview/

from ngx-treeview.

botumsu avatar botumsu commented on August 20, 2024

I faced with the same problem. I am trying to add icons for each items next to checkbox. Can you add in your demo or give some details how can we add it.

from ngx-treeview.

leovo2708 avatar leovo2708 commented on August 20, 2024

@botumsu This demo is showing button Delete beside each checkbox => https://leovo2708.github.io/ngx-treeview/#/advanced

from ngx-treeview.

botumsu avatar botumsu commented on August 20, 2024

Thanks, it works.

ps note: When source code is opened in that top of demo page, wrong code is shown (https://github.com/leovo2708/ngx-treeview/tree/master/src/demo/city).
But https://github.com/leovo2708/ngx-treeview/tree/master/src/demo/product codes should be shown

from ngx-treeview.

leovo2708 avatar leovo2708 commented on August 20, 2024

@botumsu Yes, this is my mistake. Thank for your notice. I will update demo right now.

from ngx-treeview.

Related Issues (20)

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.