Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this.tableData.filter is not a function when trying to paginate #80

Open
jaketoolson opened this issue Mar 15, 2017 · 4 comments
Open
Labels

Comments

@jaketoolson
Copy link

jaketoolson commented Mar 15, 2017

I'm currently using checkboxes in the first row and slots... when I try to click on the next page, I receive this error:

this.tableData.filter is not a function

screen shot 2017-03-14 at 10 05 31 pm

screen shot 2017-03-14 at 10 07 57 pm

It appears that this.tableData after clicking on "page 2" becomes an object of data and is no longer an array.

@ratiw
Copy link
Owner

ratiw commented Mar 16, 2017

@jaketoolson What browser are you using? I'm not sure it related to this PR, but I have verified that it really cause problem with brower other than Chrome.

@jaketoolson
Copy link
Author

@ratiw I'm using google chrome

@ratiw ratiw added the question label Mar 26, 2017
@chocopowwwa
Copy link

i'm pretty sure the issue caused by

this.tableData = this.getObjectValue(body, this.dataPath, null)

i solved the issue by converting this.tableData to array

@MichaelNgugiN
Copy link

MichaelNgugiN commented Feb 5, 2019

Came across the same issue when using _checkbox:, for laravel > 5.4, array_flatten() does the trick

 $data = array_slice($results, $offset, $pageSize, true);
            $flattened = array_flatten($data);
            $paginator = new \Illuminate\Pagination\LengthAwarePaginator($flattened, count($results), $pageSize, $page);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants