minor BUGIFX: javascript generate grid function