brinley / jSignature

jQuery plugin for adding web signature functionality
http://www.unbolt.net/jSignature
696 stars 529 forks source link

add canvas as a multiple time in already selected option's div #145

Open AshishDudhat opened 6 years ago

AshishDudhat commented 6 years ago

Hello, I would use the signature for select base as a multiple select menu. if i select one option and then second time i select second option it add a canvas in signatur div i use following code

html

  <div #signatures *ngFor="let selected of personArray">
        <div *ngIf="selected.flag == true">
            <div class="label_signature">
                <label>{{selected.name}}</label>
            </div>
            <!-- <div id="signature"></div> -->
            <div id="{{selected.name}}" style="border: 1px solid black; margin: 4%;"></div>
        </div>
    </div>

javascript

 public signObj:any = {};
 public signedPersion = [];
public personArray = [];

 this.personArray = [
     {id:1,name:"abc"},
      {id:2,name:"def"},
     {id:3,name:"ghi"}
   ];   

  for(let i=0; i<this.person.length ;i++){
          console.log('name',this.person[i].name)
          let personName = this.person[i].name

      $(document).ready(e => {
        var $sigdiv = $("#"+personName)
        var datapair = $sigdiv.jSignature({color:"#000",lineWidth:5})
      });
  }
AshishDudhat commented 6 years ago

plese solve this problem