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

Maximum call stack exceeded after destroy and reinit #13

Open
ShaibaazS opened this issue Jun 28, 2017 · 9 comments
Open

Maximum call stack exceeded after destroy and reinit #13

ShaibaazS opened this issue Jun 28, 2017 · 9 comments

Comments

@ShaibaazS
Copy link

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.

@netsudo
Copy link

netsudo commented Jul 11, 2017

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

@DreamSeason
Copy link

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.

@ashl1 ashl1 mentioned this issue Aug 26, 2017
Closed
@ashl1 ashl1 changed the title Maximum call stack exceeded. This error occured when using rowsgroup plugin. Maximum call stack exceeded after destroy and reinit Aug 26, 2017
@ashl1
Copy link
Owner

ashl1 commented Aug 26, 2017

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 referenced this issue in futpib/datatables-rowsgroup Aug 26, 2017
@jellylamp
Copy link

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

#11

@tianbis
Copy link

tianbis commented Dec 20, 2018

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

@jrsaavedra1022
Copy link

@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');
});

@mutaqin07
Copy link

@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

@ShaibaazS
Copy link
Author

ShaibaazS commented Feb 19, 2020 via email

@zulfirman
Copy link

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

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

9 participants