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

Re-init with Force duplicates the expander in the table #203

Open
TomWhitson opened this issue Aug 6, 2017 · 1 comment
Open

Re-init with Force duplicates the expander in the table #203

TomWhitson opened this issue Aug 6, 2017 · 1 comment

Comments

@TomWhitson
Copy link

I have a table using an expanderTemplate and when I call refresh as below, I end up with multiple expanders in the row,

//tree table refresh
$('#sheet1').treetable({
	expandable: true, 
	expanderTemplate:'<a href="#"><i class="material-icons">expand_more</i></a>',
	onNodeExpand:updateStriping,
	onNodeCollapse:updateStriping
}, true);
@kenjdavidson
Copy link

kenjdavidson commented Apr 4, 2018

I had this issue as well, in my case I'm wrapping my TreeTable in a DataTable (not my choice, just something I was stuck with). I have the TreeTable set to force initialization when the DataTable Ajax load completes. The blind addition of the indicator was adding multiple each reload.

I resolved it by adding:

$('.indenter',this.treeCell).remove();

on line 34.

I figured it would be best to remove the old one, and have the regular addition occur since someone may want to change the indenter or expander during the reload (different data may require more). I guess technically the class could be changed from Indenter using the indenterTemplate, so it should probably be parse to get the class.

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