yii2-datatables icon indicating copy to clipboard operation
yii2-datatables copied to clipboard

filter with multiple tables in one page

Open nrob81 opened this issue 6 years ago • 5 comments

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

nrob81 avatar Aug 07 '19 09:08 nrob81

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

ZAYEC77 avatar Aug 07 '19 13:08 ZAYEC77

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,
]);

}

nrob81 avatar Aug 08 '19 07:08 nrob81

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

ZAYEC77 avatar Aug 08 '19 09:08 ZAYEC77

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

nrob81 avatar Aug 09 '19 10:08 nrob81

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.

ZAYEC77 avatar Aug 21 '19 23:08 ZAYEC77