HtmlTable method: empty fails on empty table #1049

Closed
DrHofman opened this Issue Oct 14, 2011 · 1 comment

2 participants

@DrHofman

Hello,

Calling myTable.empty(); on an already empty HtmlTable you get this error

Uncaught TypeError: Cannot call method 'isDisplayed' of undefined

tracked it to the selectRange function for loop

for (var i = startRow; i <= endRow; i++){
            if (this.options.selectHiddenRows || rows[i].isDisplayed()) this[method](rows[i], true);
        }

Here is a quick fix:

for (var i = startRow; i <= endRow; i++){
            if (rows[i] && (this.options.selectHiddenRows || rows[i].isDisplayed())) this[method](rows[i], true);
        }

All the best
Daniel

@SergioCrisostomo
MooTools member

This has already been fixed by f55c257.

Sorry we didn't close this before.
Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment