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

Rows added dynamically do not appear in list #4

Closed
boydjd opened this issue Jan 2, 2014 · 1 comment
Closed

Rows added dynamically do not appear in list #4

boydjd opened this issue Jan 2, 2014 · 1 comment

Comments

@boydjd
Copy link

boydjd commented Jan 2, 2014

When adding rows dynamically, the list elements are not redrawn/updated. Calling $.ReStable() again on the table appends the list elements again (containing the new rows), but doesn't remove the previous rendering, resulting in duplicate lists being displayed.

@micc83
Copy link
Owner

micc83 commented Jan 5, 2014

Unfortunately the script has not been thought to update on added rows. However what you might try to do is to delete the resTable istance at each call.
Edit from line 103 (https://github.com/micc83/ReStable/blob/master/jquery.restable.js#L103)

Original:

if (responsive_table) {
    $(responsive_table).show();
} else {
    responsive_table = create_responsive_table(element, i);
}

Edit:

if (responsive_table) {
    $(responsive_table).remove();
} 
responsive_table = create_responsive_table(element, i);

Now the resTable will be rebuilt at each window resize as well as at each manual call. Give it a try and let me now...

@micc83 micc83 closed this as completed Oct 27, 2016
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