Update grid javascript