1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Primeng P-tree checkboxes aren't checkable

Discussão em 'Angular' iniciado por Tim, Junho 10, 2025.

  1. Tim

    Tim Guest

    I have a simple p-tree populated with checkboxes. I'm able to render it okay - but clicking on the checkboxes doesn't actually make them appear as checked.

    Even if I do something as simple as this in the ts file and HTML file, respectively:

    ts file:

    myObjectNodes: TreeNode[] = [];

    ngOnInit() {

    const checkbox1 = {
    label:"checkbox 1"
    };

    const checkbox2 = {
    label:"checkbox 2"
    };

    this.myObjectNodes.push(checkbox1);
    this.myObjectNodes.push(checkbox2);
    }


    HTML file:

    <p-tree [value]="myObjectNodes"
    selectionMode="checkbox">


    It renders fine - but the checkboxes never display as checked no matter how many times you click them:

    [​IMG]

    Any suggestions?

    Continue reading...

Compartilhe esta Página