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

filter with multiple tables in one page #54

Open
nrob81 opened this issue Aug 7, 2019 · 5 comments
Open

filter with multiple tables in one page #54

nrob81 opened this issue Aug 7, 2019 · 5 comments

Comments

@nrob81
Copy link

nrob81 commented Aug 7, 2019

Hello,

I have multiple tables in one page and my row filtering won't works.
Wth one table, its working.

the error i get in console is:
TypeError: preSearch[column] is undefined jquery.dataTables.js:9072:6

@ZAYEC77
Copy link
Contributor

ZAYEC77 commented Aug 7, 2019

hello @nrob81
please provide part of source code where you call datatables widgets

@nrob81
Copy link
Author

nrob81 commented Aug 8, 2019

foreach ($content['tables'] as $tableId => $table) {

foreach ($table['columns'] as $key) {
    $column = [
        'data' => $key,
        'title' => $model->getAttributeLabel($key),
    ];
    $columns[] = $column;
}
                                    
echo \nullref\datatable\DataTable::widget([
    'data' => $table['data'],
    'columns' => $columns,
    'paging' => false,
    'ordering' => false,
    'info' => false,
    'withColumnFilter' => true,                                 
    'id' => $tableId,
]);

}

@ZAYEC77
Copy link
Contributor

ZAYEC77 commented Aug 8, 2019

Thanks, I'll try to reproduce it
It will be useful if you could add full stack trace of JS error from console

@nrob81
Copy link
Author

nrob81 commented Aug 9, 2019

TypeError: preSearch[column] is undefined[Learn More] 3 jquery.dataTables.js:9072:6
	<anonymous> http://r.local/assets/4a415d84/js/jquery.dataTables.js:9072:6
	iterator http://r.local/assets/4a415d84/js/jquery.dataTables.js:7057:14
	<anonymous> http://r.local/assets/4a415d84/js/jquery.dataTables.js:9067:11
	_api_registerPlural/< http://r.local/assets/4a415d84/js/jquery.dataTables.js:7311:14
	methodScoping/< http://r.local/assets/4a415d84/js/jquery.dataTables.js:7195:16
	<anonymous> http://r.local/kontrolny/default/index:870:17
	dispatch http://r.local/assets/771ef92b/jquery.js:4736:16
	add/elemData.handle http://r.local/assets/771ef92b/jquery.js:4549:6

@ZAYEC77
Copy link
Contributor

ZAYEC77 commented Aug 21, 2019

Hey @nrob81
Sorry, but I can't reproduce this kind of issue with last dev-master version.
Also, I found another issue connected with multiple tables with filters on one page.
Please, check my examples here.
If you still have an issue, please contact me, we try to resolve it individually.

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

No branches or pull requests

2 participants