Hide data grid in Custom Script

Standard HR.Net Java Script tools does not allow to hide data grids, but this is sometimes required.
Here is a JS function to hide data grids.

function hideDataGrid(gridName){

	var grid = document.getElementById(name); 

	var openButton = document.getElementById(name+"Grid_ImgOpen");

	var insertButton = document.getElementById(name+"Grid_ImgInsert");

	var deleteButton = document.getElementById(name+"Grid_ImgDelete");


  if (grid != null)  grid.style.display = 'none';  

	if (openButton != null) openButton.style.display = 'none';

  if (insertButton != null) insertButton.style.display = 'none';

  if (deleteButton != null) deleteButton.style.display = 'none';



This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

One Response to Hide data grid in Custom Script

  1. Dan Hutson says:

    I’ve not used this coding but if I want to show the data grid but prevent a new record being added, in this example if a flag is equal to ‘true’, an alert is shown if a user clicks the insert button.

    if ($HRnet("NameofField").getStoreValue() == 'T') {

    var grid1Insert = document.getElementById("Grid1Grid_ImgInsert");
    grid1Insert.onclick = noNewRecord;


    function noNewRecord() {

    alert("Enter your alert text here");


Leave a Reply

Your email address will not be published. Required fields are marked *