EloquentStudio / StreamTable.js

StreamTable.js streams data for tables in the background, updates and renders them using templating frameworks like Mustache.js, HandleBars.js
http://eloquentstudio.github.io/StreamTable.js/stream.html
MIT License
386 stars 77 forks source link

Added 'All' in Per Page select box options #39

Closed Prashantbangar03 closed 1 year ago

Prashantbangar03 commented 4 years ago

Problems:-

  1. If a user wants to show "All data on a single page then he can't show because in the pagination select box there is no option to show "All" data on a single page.
  2. When a user searches a specific word into data then searched results are showed on multiple pages depending on per_page size, when user checking searched results are correct or not. then he should go to every page and check results.

Proposed Solution:-

  1. I have added a two-dimensional array in paging_opts object, Like per_page_opts: [[10,25,50,-1],[10,25,50,"All"]]
    • the per_page_otps[0] used for select option value - [10,25,50,-1], -per_page_otps[1] userd for select option name - [10,25,50,"All"] so when user select 'All' from select box then paging_opts.per_page value will be -1.
  2. In render function I have added one condtion to check page value is -1 or not , if yes then I am setting l = data.length to render all data on a single page. this is how the proposed code will solve the above problem