0
votes
   columns: {
      Name: {
    title: 'Name',
         filter: false,
  },
  Description: {
    title: 'Description',
         filter: false,


  },
},
add: {
  addButtonContent: '<i class="nb-plus"></i>',
  createButtonContent: '<i class="nb-checkmark"></i>',
  cancelButtonContent: '<i class="nb-close"></i>',
},
edit: {
  editButtonContent: '<i class="nb-edit"></i>',
  saveButtonContent: '<i class="nb-checkmark"></i>',
  cancelButtonContent: '<i class="nb-close"></i>',
},
delete: {
  deleteButtonContent: '<i class="nb-trash"></i>',
  confirmDelete: true,
},

};

source: ServerDataSource;

constructor(private http: Http, globals: Globals) {

this.source = new ServerDataSource(http, { endPoint: GlobalVariable.BASE_API_URL+'/api/InspectionService/GetInspectionStatus' });

}

i populated the data inside the ng2 smart table by the above method .. but the pagination is not appearing on the view ... what do i miss ? how to make the pagination appear for using serverdatasource ??

2

2 Answers

0
votes

As far as I know the Pager is set automatically. If you look for "pager.display" and "pager.perPage" in the documentation you will se the default values.

In my experience the pager doesn't work/show if there is some problem in the data or the configuration. Are you sure your data and configuration is correct and there are no errors?

If you want to set the pager to a different value you can do it in your configuration:

this.settings = {
            columns: {
              ...
            },
            ...
            pager:
            {
              perPage: 20
            }
          };

Or you can set it with the DataSource:

this.source.setPaging(2,20);
0
votes

I use this way and it works

this.YourlocalDataSource.setPaging(1, 10, true);

10 number of rows for page