Fixed the gridToggle function.
Using a jquery selector to target the gridMaterial element.
Coudlnt use a ui element in the view because the item hadnt been loaded yet.