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

Takes a lot of time to initialize if there are more than 500 columns #123

Open
greyblackhat opened this issue May 31, 2021 · 1 comment
Open

Comments

@greyblackhat
Copy link

React strap Table
I'm using this for react strap table, and it takes around 40 to 50 seconds to resize. Is there any thing i can do ?

@greyblackhat greyblackhat changed the title Takes a lot of time to initialize if there are more than 800 columns Takes a lot of time to initialize if there are more than 500 columns Jun 1, 2021
@emcodem
Copy link

emcodem commented Nov 24, 2024

change

$(window).on('resize.'+SIGNATURE, onResize);

to

	function debounce(func){
		//used to prevent firing window onresize "while the window is resized", e.g. wait 100ms for no size change and only then execute the function
		var timer;
		return function(event){
			if(timer) clearTimeout(timer);
			timer = setTimeout(func,500,event);
		};
	};
	$(window).on('resize.'+SIGNATURE, debounce(onResize)); 

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