Ngx-datatable: How do we style the emptyMessage?

Created on 27 Nov 2017  路  4Comments  路  Source: swimlane/ngx-datatable

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[x ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

I basically need to style the empty message as html.
Is it possible to do it?
Using v9.3.1

Most helpful comment

Here's how I do it for someone trying to do the same thing.

in xx.component.ts

messages = {
  emptyMessage: `
    <div>
      <img src="/pathtoimage">
      <span class="classname">No results</span>
      <p>text</p>
    </div>
  `
}

in xx.component.html

<ngx-datatable
 ...
 [messages]="messages"
></ngx-datatable>

All 4 comments

Here's how I do it for someone trying to do the same thing.

in xx.component.ts

messages = {
  emptyMessage: `
    <div>
      <img src="/pathtoimage">
      <span class="classname">No results</span>
      <p>text</p>
    </div>
  `
}

in xx.component.html

<ngx-datatable
 ...
 [messages]="messages"
></ngx-datatable>

Can we use ElementRef as emptyMessage ?

@resting Your solution is helpful. However, you will run into an issue with Angular's DomSanitizer cleaning your html if you have items like a

I can only agree, still looking for this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

WA-WilliamKrieg picture WA-WilliamKrieg  路  3Comments

lautarobock picture lautarobock  路  3Comments

devendraYebhi picture devendraYebhi  路  3Comments

IngoManthey picture IngoManthey  路  3Comments

DethAriel picture DethAriel  路  3Comments