angular2-multiselect-dropdown icon indicating copy to clipboard operation
angular2-multiselect-dropdown copied to clipboard

Custom c-item causes empty label with width 120px

Open mado89 opened this issue 6 years ago • 2 comments

I am trying to use a custom c-item using the provided samples. However, my dropdown shows all items indented.

html:

<angular2-multiselect [data]="itemList" formControlName="selectedItems" [settings]="settings" 
    (onSelect)="onItemSelect($event)" (onDeSelect)="OnItemDeSelect($event)"  (onSelectAll)="onSelectAll($event)" (onDeSelectAll)="onDeSelectAll($event)">
    <c-item>
      <ng-template let-item="item">
        <label style="color: #333;min-width: 150px;">{{item.itemName}}</label>
        <img [src]="item.image" style="width: 30px; border: 1px solid #efefef;margin-right: 20px;" />
        <label>Capital - {{item.capital}}</label>
      </ng-template>
    </c-item>    
  </angular2-multiselect>

ts:

this.settings = {
          text:"Select Countries",
          selectAllText: 'Select All',
          unSelectAllText: 'UnSelect All',
          enableSearchFilter: true,
          classes: "myclass custom-class",
          showCheckbox: true,
          primaryKey: 'id',
          labelKey: 'itemName'
        };
    this.myForm = this.fb.group({
      selectedItems: new FormControl(this.selectedItems, []),
    });

css

.custom-class {
  color: #f00;
}
.custom-class .c-token{
  background: #38d574 !important;
}
.custom-class .pure-checkbox label::before {
  border-color: #38d574 !important;
}
.custom-class .pure-checkbox input[type="checkbox"]:checked + label[_ngcontent-c1]:before {
  background: #38d574 !important;
}

angular.json

"styles": [
              "node_modules/font-awesome/scss/font-awesome.scss",
              "node_modules/angular-bootstrap-md/scss/bootstrap/bootstrap.scss",
              "node_modules/angular-bootstrap-md/scss/mdb-free.scss",
              "node_modules/angular2-multiselect-dropdown/themes/default.theme.css",
              "src/styles.scss"
            ]

This is how the dropdown looks like image which is different to the example

What could cause this issue?

mado89 avatar Sep 16 '19 10:09 mado89

Any news or help on how to prevent this would be welcome :)

mado89 avatar Dec 07 '19 14:12 mado89

Please help me this custom template

 <ng-template let-item="item">
   <label style="color: #fff;min-width: 150px;"></label>
   <img [src]="item.image" style="width: 30px; border: 1px solid #efefef;margin-right: 20px;" />
   <label>Capital - </label>
 </ng-template>
</c-item>  ```
is not reflecting in my project.

i want to add custom template in my project. please help me .
why it's not reflecting @pickardjoe 

pshobha97 avatar Mar 26 '21 06:03 pshobha97