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

Maximum call stack exceeded after destroy and reinit

Open ShaibaazS opened this issue 8 years ago • 9 comments

First time when the data is generated with Data parameter the DataTable & rowsGroup loads perfectly. When I make a ajax call to get new Data for the DataTable, I do ".clear()" & ".destroy()" and repopulate the DataTable. But my page Hangs and I face this error "Maximum call stack size exceeded". After 5-10 secs the DataTable loads with the new data and rows group modifications. I have tried with all possbile solutions but getting the same Error. Hoping for a reply.

ShaibaazS avatar Jun 28 '17 10:06 ShaibaazS

I have the exact same issue. Are you by any chance using the SmartAdmin template?

netsudo avatar Jul 11 '17 03:07 netsudo

I've experienced the same issue here. At last, I found a way to bypass it. Simply avoid destroying the table if you can. Rather you clear the table and use the rows.add().draw() to update the content. In a word, keep the table instance unchanged but refresh its data.

DreamSeason avatar Aug 14 '17 03:08 DreamSeason

Yes. This is known defect in plugin. I discovered it before the first release but used the plugin only for one table without any reinit. This should be fixed soon (I expect so)

ashl1 avatar Aug 26 '17 13:08 ashl1

When will futpib's commits be merged into master? His fix for this works for me.

https://github.com/ashl1/datatables-rowsgroup/pull/11

jellylamp avatar Jun 22 '18 16:06 jellylamp

#11 Works for me too. In particular, I'm using the destroy:true option, and now it's working fine.

tianbis avatar Dec 20 '18 18:12 tianbis

@ashl1 Hello, I really liked the plugin, to destroy the table you can include this code, for those who work with ajax.

$(document).on( 'destroy.dt', function ( e, settings ) { var api = new $.fn.dataTable.Api( settings ); api.off('order.dt'); api.off('preDraw.dt'); api.off('column-visibility.dt'); api.off('search.dt'); api.off('page.dt'); api.off('length.dt'); api.off('xhr.dt'); });

jrsaavedra1022 avatar Sep 09 '19 16:09 jrsaavedra1022

@ashl1 Hello, I really liked the plugin, to destroy the table you can include this code, for those who work with ajax.

$(document).on( 'destroy.dt', function ( e, settings ) { var api = new $.fn.dataTable.Api( settings ); api.off('order.dt'); api.off('preDraw.dt'); api.off('column-visibility.dt'); api.off('search.dt'); api.off('page.dt'); api.off('length.dt'); api.off('xhr.dt'); });

it works

mutaqin07 avatar Feb 19 '20 08:02 mutaqin07

Thanks mutaqin07. On Wednesday, February 19, 2020, 01:32:30 PM GMT+5:30, mutaqin07 [email protected] wrote:

@ashl1 Hello, I really liked the plugin, to destroy the table you can include this code, for those who work with ajax.

$(document).on( 'destroy.dt', function ( e, settings ) { var api = new $.fn.dataTable.Api( settings ); api.off('order.dt'); api.off('preDraw.dt'); api.off('column-visibility.dt'); api.off('search.dt'); api.off('page.dt'); api.off('length.dt'); api.off('xhr.dt'); });

it works

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

ShaibaazS avatar Feb 19 '20 10:02 ShaibaazS

futpib's fix is work, why still not merge it into master ??

zulfirman avatar Oct 15 '20 10:10 zulfirman