ng2-smart-table icon indicating copy to clipboard operation
ng2-smart-table copied to clipboard

HTML in column title.

Open yangwen2 opened this issue 7 years ago • 7 comments

I have a use case where the column header needs to have iconography. Is it possible to have HTML content as column title?

yangwen2 avatar Jun 13 '17 03:06 yangwen2

+1 I also have the very same issue

Anandamohinidasi avatar Jun 20 '17 17:06 Anandamohinidasi

I'm hacking it right now. Assigned each column a unique css class. Then injecting dom elements into the ng2-smart-table-title element in my component's AfterViewInit function.

yangwen2 avatar Jun 20 '17 17:06 yangwen2

bump.

cgebe avatar Jun 29 '17 12:06 cgebe

@yangwen2 did you get the solution? if yes plz share

PK1NONLY avatar Feb 06 '18 09:02 PK1NONLY

Yes like I said in the June 20 comment above. I have a hack work around. In the column config object I have something like below to assign a css class to the column header. Then that allows me to target this element in the future and set the innerHTML property of it.

meterNumber: { title: 'Meter #', class: 'meter-number-column', sortDirection: 'asc', filter: false },

yangwen2 avatar Feb 06 '18 13:02 yangwen2

Is there any other way than this??

samir-kamble avatar Aug 20 '20 10:08 samir-kamble

Here is the way I add icon non interactive to header using pure css:

.slash-outlined {
  .ng2-smart-title {
    display: inline-block;
    white-space: nowrap;

    &::before {
      display: inline-block;
      width: 20px;
      vertical-align: middle;
      margin-right: 5px;
      content: url(/assets/images/slash-outline.svg);
    }
  }
}

There result image

korifeich avatar Oct 06 '22 10:10 korifeich