function attachAutoResizeDataGrid(grid, gridId, gridContainerId) {
  var gridDomElm = $('#' + gridId);
  if (!gridDomElm || typeof gridDomElm.offset() === "undefined") {
    // if we can't find the grid to resize, return without attaching anything
        return null;
  }
  //-- 1st resize the datagrid size on first load (because the onResize is not triggered on first page load)
  resizeToFitBrowserWindow(grid, gridId, gridContainerId);
  //-- 2nd attach a trigger on the Window DOM element, so that it happens also when resizing after first load
  $(window).on("resize", function () {
    // for some yet unknown reason, calling the resize twice removes any stuttering/flickering when changing the height and makes it much smoother
    resizeToFitBrowserWindow(grid, gridId, gridContainerId);
    resizeToFitBrowserWindow(grid, gridId, gridContainerId);
  });
  // in a SPA (Single Page App) environment you SHOULD also call the destroyAutoResize()
}
/** Attach an auto resize trigger on the datagrid, if that is enable then it will resize itself to the available space
  * Options: we could also provide a % factor to resize on each height/width independently
  */
Attach an auto resize trigger on the datagrid, if that is enable then it will resize itself to the available space
Options: we could also provide a % factor to resize on each height/width independently
Attach an auto resize trigger on the datagrid if that is enable then it will resize itself to the available space Options : we could also provide a % factor to resize on each height / width independently
function attachAutoResizeDataGrid(grid, gridId, gridContainerId) {
  var gridDomElm = $('#' + gridId);
  if (!gridDomElm || typeof gridDomElm.offset() === "undefined") {
        return null;
  }
  resizeToFitBrowserWindow(grid, gridId, gridContainerId);
  $(window).on("resize", function () {
    resizeToFitBrowserWindow(grid, gridId, gridContainerId);
    resizeToFitBrowserWindow(grid, gridId, gridContainerId);
  });
}
function attachAutoResizeDataGrid ( grid , gridId , gridContainerId ) { var gridDomElm = $ ( '#' + gridId ) ; if ( ! gridDomElm || typeof gridDomElm . offset ( ) === "undefined" ) { return null ; } resizeToFitBrowserWindow ( grid , gridId , gridContainerId ) ; $ ( window ) . on ( "resize" , function ( ) { resizeToFitBrowserWindow ( grid , gridId , gridContainerId ) ; resizeToFitBrowserWindow ( grid , gridId , gridContainerId ) ; } ) ; }
Attach an auto resize trigger on the datagrid, if that is enable then it will resize itself to the available space
 Options: we could also provide a % factor to resize on each height/width independently
Attach an auto resize trigger on the datagrid if that is enable then it will resize itself to the available space Options : we could also provide a % factor to resize on each height / width independently
// if we can't find the grid to resize, return without attaching anything //-- 1st resize the datagrid size on first load (because the onResize is not triggered on first page load) //-- 2nd attach a trigger on the Window DOM element, so that it happens also when resizing after first load // for some yet unknown reason, calling the resize twice removes any stuttering/flickering when changing the height and makes it much smoother // in a SPA (Single Page App) environment you SHOULD also call the destroyAutoResize()