lorenzofox3 / Smart-Table

Code source of Smart Table module: a table/grid for Angularjs
http://lorenzofox3.github.io/smart-table-website/
1.8k stars 513 forks source link

Problem with st-pipe #767

Closed YamilBracho closed 7 years ago

YamilBracho commented 7 years ago

Hi, everybody

I am using st-pipe to load some data records from my server. When the screen is showm, the grid must be empty so the st-pipe function (say list) is not called (Whne it is called but i use a falg to return inmediately). The user enter some criteria in a modal dialog and then I call "list" in the ng-click clause of that button. the problem is that the pagination is not shown. If I force to call list() the first time, the pagiantion is shown as I retrieved all the data rows.

Is there a way to refresh the inner vars of smart-table ?

I am using Angular 1.6, Smart-Table 2.1.8

TIA, Yamil

MrWook commented 7 years ago

Hello @YamilBracho,

if im right you want a page with a smart-table but it shouldn't get any data on page load. The table should only be filled when you click on a specific button? And your problem is that when you click on that button to fill the table the pagination isn't shown?

I think that you don't fill the necessary variables when you click on that button in your pipe. Be sure you filled them. Like you can see in the templateCache for the Smart-Table there is a ng-if

    <nav ng-if="numPages && pages.length >= 2"><ul class="pagination">

So numPagesneed to be filled and pages need to have at least two entries to show you the standard pagination.

If you need further investigation please provide us with a plunker example.