Datatable sorting [Sort icons not visible]

UI Components for Angular
Post Reply
kumawat
Posts: 27
Joined: 11 Mar 2016, 15:26

14 Mar 2016, 12:09

Hi prime,

I have upgraded datatable to ver. 0.7.0.

I have configured column sorting like this.

<p-dataTable [value]="rowData" resizableColumns="true" [responsive]="true">
<p-column *ngFor="#col of columnDefs" [field]="col.field" [header]="col.header" [style]="col.style" [sortable]="true"></p-column>
</p-dataTable>

it showing datatable where i can resize columns that's working fine. Actually, i have only single row as rowData and column sorting is not working.

Is that due to single row in the data table?

Please help me with this.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

14 Mar 2016, 12:16

Do you have font awesome included on your page? PrimeNG uses font-awesome icons. Do you see a span inside the th like in screenshot;

Image

kumawat
Posts: 27
Joined: 11 Mar 2016, 15:26

14 Mar 2016, 12:46

Yeah I see this span for Sorting.

Now see, what if i don't want to use font-awesome in the application and use another icons instead. Is that possible?

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

14 Mar 2016, 16:06

For custom icons, you can use whatever you like for sure but to customize PrimeNG icons, you need to override font awesome icons like fa-sort-asc and provide your own icon content. So fontawesome styles will be there as placeholders like fa fa-sort and content will come from your overrides. I can't think of another way right now.

So adding font awesome fixed the issue for you?

kumawat
Posts: 27
Joined: 11 Mar 2016, 15:26

14 Mar 2016, 17:42

Hi Prime,

Adding Font-awesome fixed the issue. I can atleast go with it for now but for sure will need to replace it with my own icons.

Your controls are awesome along with your team support. :)

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

14 Mar 2016, 18:30

We'd like to hear your feedback to see if we can provide hooks to override icons easily.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 27 guests