The Primeng Dataview buttons don’t look like

Asked

Viewed 500 times

1

See the image below with the arrow indicating which is the button; inserir a descrição da imagem aqui

That button’s not showing, it’s supposed to be like this;

inserir a descrição da imagem aqui

What is going on? No error message appears anywhere.

This is a Primeng library using Angular.

=======================UPDATING=================

This is my repository;

This is my page with problem;

 <!--INICIO DO CONTEUDO-->
 <section class="content-header">
    <h3>{{ title }}</h3>
  </section>

  <section class="content">
   <section class="invoice">       

      <div class="container">
          <div class="ui-g">

      <form autocomplete="off" (ngSubmit)="pesquisar()">
            <div class="ui-g-12 ui-md-6 ui-fluid">
              <label>Valor</label>
              <input pInputText type="text" name="price" [(ngModel)]="filtro.price"  pTooltip="Realizar consulta pelo valor do Cardápio" tooltipPosition="top">
            </div>

            <div class="ui-g-12">
              <button pButton type="submit" label="Pesquisar"></button>
            </div>
      </form> 
          </div>
          <div class="ui-g">
            <div class="ui-g-12 ui-md-7">
                <p-dataTable [value]="menu"  
                [paginator]="true" [rows]="5"
                [responsive]="true"
                emptyMessage="Nenhum menu encontrado"
                [paginator]="true" [rows]="filtro.itensPorPagina"
                [lazy]="true" [totalRecords]="totalRegistros"
                (onLazyLoad)="aoMudarPagina($event)"  #tabela>

                    <p-column field="name" header="Nome" styleClass="col-data"></p-column>
                    <p-column field="description" header="Descrição" styleClass="col-desc"></p-column>
                    <p-column field="price" header="Valor" styleClass="col-valor">
                        <ng-template let-lanc="rowData" pTemplate="body">
                            <span >{{ lanc.price | number:'1.2-2' }}</span>
                        </ng-template>
                    </p-column>
                    <p-column styleClass="col-acoes">
                            <ng-template let-lanc="rowData"  pTemplate="body">
                            <button pButton icon="fa fa-pencil" pTooltip="Editar" tooltipPosition="top"></button>
                            <button pButton icon="fa fa-trash" 
                                pTooltip="Excluir" 
                                tooltipPosition="top" 
                                (click)="confirmarExclusao(lanc)">
                            </button>
                            </ng-template>
                        </p-column>
                </p-dataTable>

            </div>

        </div>

        </div>

    </section>
  </section>


  <!--
  <a pButton class="pi pi-pencil"></a>


  <table class="table table-hover ">
            <thead class="thead-default">
            <tr>
                <th>Nome</th>
                <th>Descrição</th>
                <th>Ação</th>
            </tr>
            </thead>
            <tbody>
                <tr *ngFor="let menu of menus">
                <td>{{ menu.name }}</td>
                <td>{{ menu.description }}</td>
                <td>
                    <a  class="btn btn-sm btn-primary">
                        <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
                        Editar
                    </a>
                </td>
                </tr>
            </tbody>
        </table>




  -->

This is where I’ve installed the modules;

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { MainComponent } from './restaurant/main/main.component';
import { ListComponent } from './restaurant/list/list.component';
import { AddComponent } from './restaurant/add/add.component';
import { EditComponent } from './restaurant/edit/edit.component';
import { AdminRoutingModule } from './routes/admin-routing.module';
import { SharedModule } from '../shared/shared.module';
import { AddmenuComponent } from './menu/addmenu/addmenu.component';
import { ListmenuComponent } from './menu/listmenu/listmenu.component';
import { EditmenuComponent } from './menu/editmenu/editmenu.component';

import { InputTextModule } from 'primeng/components/inputtext/inputtext';
import { ButtonModule } from 'primeng/components/button/button';
import { DataTableModule } from 'primeng/components/datatable/datatable';
import { TooltipModule } from 'primeng/components/tooltip/tooltip';
import { DropdownModule } from 'primeng/components/dropdown/dropdown';

@NgModule({
  imports: [
    CommonModule,
    BrowserAnimationsModule,

    FormsModule,
    AdminRoutingModule,
    SharedModule,

    //Módulos de terceiros
    InputTextModule,
    ButtonModule,
    DataTableModule,
    TooltipModule,
    DropdownModule

  ],
  declarations: [
    MainComponent, 
    ListComponent, 
    AddComponent, 
    EditComponent,


    AddmenuComponent, 
    ListmenuComponent, 
    EditmenuComponent
  ],
  exports: [
    MainComponent, 
    ListComponent, 
    AddComponent, 
    EditComponent, 


    AddmenuComponent, 
    ListmenuComponent, 
    EditmenuComponent
  ], 

})
export class AdminModule { }
  • 1

    Forgive my ignorance, but there are more than 4 pages?

  • 1

    @lazyFox quiet, this image capture showing 5 pages was just to demonstrate what kind of button I would need to have, in my project only has 4 pages :P

  • 1

    I don’t know the library PrimeNG but don’t the arrows appear only when there are more than 4 pages? Otherwise it would not make much sense to have arrows, their existence would be completely unnecessary.

  • 1

    @lazyFox was to appear the arrows, it is because you do not know the library of Primeng.

  • 1

    I take it back, I tested it here with a filter and really arrows are present. My bad. It is best to put your code here and check if there are no errors on the console. It may also be the lack of library sources.

  • 1

    @lazyFox thanks for trying to help me, I just updated my post , please take a look.

  • 1

    there are no errors in the browser console, neither in the code nor in the MSDOS console where the command is run ng serve

  • 1

    You’re probably having trouble adding Font-awsome to your project

  • 1

    @Eduardovargas because you think this is Font-awsome problem? this is a Primeng component problem has nothing to do with Font-awsome.

  • 1

    @Eduardovargas if it is the Font-awsome which version would you recommend me to install?

  • 2

    https://www.primefaces.org/primeng/#/setup installs this primeicons

  • 1

    @Eduardovargas you are right I installed the primeicons and imported the css file from lib thank you very much, it worked perfectly.

  • 1

    Put the reply @Eduardovargas in my post so I mark it as correct, please :)

Show 8 more comments

1 answer

2


Install the Primeng icon pack.

Add to angular.json the path (path) to the icon CSS:

"styles": ["node_modules/primeicons/primeicons.css"]
  • 1

    Oops, I didn’t see the other answers, you solved it! Blaz then...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.