Issue #1880798 by droplet: Fixed tableselect.js performances.

PR for http://drupal.org/node/1880798
Doesn't look like $i is defined here, so this would cause a JS error.