samedi 29 février 2020

Primefaces Tree : The checkbox selection gets deselected when I click on the button to open modal on the parent / child node

Hi I'm using the component Tree - Selection with the variant Checkbox. Everything in the component is working fine but I need to put a button next to every parent and child of my nodes to open a model which happen with the id of that node, the problem is that if I press the button that unchecks that node. This is my code

 <p-tree [value]="casePartyServiceContactModel" selectionMode="checkbox"
                                    [(selection)]="selectedServiceContactsTree" (onNodeSelect)="nodeSelect($event)"
                                    (onNodeUnselect)="nodeUnselect($event)">
                              <template let-node pTemplate="default">
                                <span class="listname"></span>

                                <span class="listicons pull-right" *ngIf="!node.parent">
                                <button type="button" class="btncontact btn-primary box mar-r-20 pad-t-2 pad-b-2" data-toggle="modal" (click) = "setCasePartyIdForServiceContacts(node.data.partyID,node.data.caseId)"
                                        data-target="#addServiceContactToCase">Add Service Contact To Case
                                </button>

                                </span>

                                <span class="listicons pull-right" *ngIf="node.parent">
                                           <button type="button" class="buttonicon blueicon" data-toggle="modal"
                                                   data-target="#viewservicecontactdetails"
                                                   pTooltip="View Service Contact Details"
                                                   (click)="getServiceContactDetail(node.data.serviceContactID);"
                                                   tooltipPosition="top">
                                                     <i class="fa fa-user" aria-hidden="true"></i>
                                            </button>
                                            <button type="button" class="buttonicon blueicon" data-toggle="modal"
                                                    data-target="#viewattachedcaselist"
                                                    pTooltip="View Attached Case List"
                                                    (click)="attachedCaseList(node.data.serviceContactID,node.data.firstName,node.data.lastName)"
                                                    tooltipPosition="top">
                                              <i class="fa fa-paperclip" aria-hidden="true"></i>
                                            </button>

                                            <button type="button" class="buttonicon blueicon" pTooltip="Detach Contact"
                                                    *ngIf="node.data.editableFlag"
                                                    (click)="detachContact(node.data.serviceContactID,node.parent.data.caseId,node.parent.data.partyID,false)"
                                                    tooltipPosition="top">
                                              <i class="fa fa-trash" aria-hidden="true"></i>
                                            </button>
                                        </span>
                              </template>
                            </p-tree>



1 commentaire:

  1. As claimed by Stanford Medical, It is indeed the ONLY reason women in this country get to live 10 years longer and weigh an average of 42 pounds less than we do.

    (And actually, it really has NOTHING to do with genetics or some hard exercise and absolutely EVERYTHING related to "how" they eat.)

    BTW, I said "HOW", and not "WHAT"...

    TAP on this link to find out if this easy questionnaire can help you find out your real weight loss possibility

    RépondreSupprimer