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

DOMException when rendering the grid multiple times within a short amount of time #85

Closed
zernyu opened this issue Feb 15, 2012 · 3 comments

Comments

@zernyu
Copy link

zernyu commented Feb 15, 2012

This is probably the same issue as: #81

If you go to http://sitepen.github.com/dgrid/dgrid/test/JsonRest.html and type this into the console:

for (var i  = 0; i < 10; i++) {
    grid.refresh();
}

you'll get flooded by DOMExceptions.

I've temporarily "fixed" this by modifying whenDone() in renderArray() of dgrid/List.js to look like this:

function whenDone(resolvedRows){
    // Fix for DOMExceptions caused by querying the grid too fast
    try {
        (beforeNode && beforeNode.parentNode || self.contentNode).insertBefore(rowsFragment, beforeNode || null);
        lastRow = resolvedRows[resolvedRows.length - 1];
        lastRow && self.adjustRowIndices(lastRow);
    } catch (exception) {
        if (!exception instanceof DOMException) {
            console.error(exception);
        }
    }
    return rows = resolvedRows;
}

I have a feeling this might lead to memory leaks. Hopefully someone can come up with a better solution!

@SitePenChrisBarrett
Copy link
Contributor

swiftdemise,
just so you know, http://sitepen.github.com/dgrid/dgrid/test/, is totally not up to date. It's better to pull a local copy from master. Not saying that you won't find the same problems, but testing against that location won't help at all :)

@zernyu
Copy link
Author

zernyu commented Feb 15, 2012

Yep I know that. My project is running master and I wanted to demonstrate the issue and it turns out the test page has the same behavior.

@ghost
Copy link

ghost commented Feb 24, 2012

This should be fixed with #103. If you still have problems, let us know. Thanks!

@ghost ghost closed this as completed Feb 24, 2012
This issue was closed.
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