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

Smart-Table filtering and paging with CheckBoxes #822

Open devwheel opened 6 years ago

devwheel commented 6 years ago

Might be that I'm doing something wrong so would love to know how to solve this. [http://plnkr.co/edit/SkISTVludkqhNvw9gBDN?p=preview] In this plunker, I have a checkbox that filters the data in the smart-table. I specify 10 items per page in my pagination. When de-select the comedy check box, the page filters out the 2 comedy titles on in the table but does not re-adjust the pages.
The way that I've implemented this, it simply removes the rows on each page vs recalculating the paging based on the filter. Stuck... Any help would be appreciated.

MrWook commented 6 years ago

Hello @devwheel,

i just took a quick look at you plunk. There are a few problems.

  1. The loaded Angular librarys have all different versions and you load two different angularjs versions. if you load AngularJs 1.6.6 the other core angular librarys need to have the same version. In your plunk you include angular-animate and angular-touch. Both of them are core angular librarys that need to match the angular version
  2. You filter the displayed data directly in ng-repeat with filter:filterTypes. Therefore the pagination directive never knew that you played with the data. You need to use the stSearch directive on the checkboxes.