spatie / vue-table-component

A straight to the point Vue component to display tables
http://vue-table-component.spatie.be
MIT License
588 stars 149 forks source link

:pagination implementation without axios? #98

Closed GreggOrdHume closed 6 years ago

GreggOrdHume commented 6 years ago

Hello,

Looking through the documentation I am finding it difficult to implement pagination without axios, is this possible? I have done the following, it doesn't completely make sense but was worth a shot.

<table-component
  :data="lookupData"
  filter-placeholder="Search <%= typePlural %>"
  filter-no-results="No results found"
>

  <% fields.forEach(field => { %> // ejs looping in columns
  <table-column label="<%= field.header %>" show="<%= field.field %>" :filterable="true"><%- field.template || '' %></table-column>
  <% }) %>

  <template slot="tfoot">
    <pagination
      :pagination="{
        currentPage: 1,
        totalPages: 10
      }"
    >
    </pagination>
  </template>

</table-component>

The pagination does appear but no clicking or styling is applied.

Thanks!

GreggOrdHume commented 6 years ago

I would be happy to contribute to this repository seeing as I am raising multiple issues. Even if it is documentation updates or code/fiddle examples, I am looking to help out. Let me know if theres anything you need assistance in :)

Konafets commented 6 years ago

@GreggOrdHume Pagination w/o axios aka an Ajax call means, that you need all data in the frontend. This makes only sense with a small dataset. When the amount of data grows, the time to fetch and render all data increases and lead slow frontend experience.

GreggOrdHume commented 6 years ago

Understandable @Konafets . But I would say a table with 5 pages of 10 rows per page is not a lot of data and would not offend the performance. What would offend the performance is having to do a request for 10 rows of data every time i change the page, when it could have been there in the first place.

Not every table has pagination because its 1000 rows long. Also how am I going to search through rows I don't have?

THAlpha commented 6 years ago

Does filtering work on tables with pagination?

spatie-bot commented 6 years ago

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.